PDF version

PMF

Suppose there is a sequence of independent Bernoulli trials, each trial having two potential outcomes called "success" and "failure". In each trial the probability of success is $p$ and of failure is $(1-p)$. We are observing this sequence until a predefined number $r$ of failures has occurred. Then the random number of successes we have seen, $X$, will have the negative binomial (or Pascal) distribution: $$f(x; r, p) = \Pr(X=x) = {x + r-1\choose x}p^{x}(1-p)^{r}$$ for $x = 0, 1, 2, \cdots$.

Proof:

$$ \begin{align*} \sum_{x =0}^{\infty}P(X = x) &= \sum_{x= 0}^{\infty} {x + r-1\choose x}p^{x}(1-p)^{r}\\ &= (1-p)^{r}\sum_{x=0}^{\infty} (-1)^{x}{-r\choose x}p^{x}\;\;\quad\quad (\mbox{identity}\ (-1)^{x}{-r\choose x}= {x+r-1\choose x})\\ &= (1-p)^r(1-p)^{-r}\;\;\quad\quad\quad\quad\quad\quad (\mbox{binomial theorem})\\ &= 1 \end{align*} $$ Using the identity $(-1)^{x}{-r\choose x}= {x+r-1\choose x}$: $$ \begin{align*} {x+r-1\choose x} &= {(x+r-1)!\over x!(r-1)!}\\ &= {(x+r-1)(x+r-2) \cdots r\over x!}\\ &= (-1)^{x}{(-r-(x-1))(-r-(x-2))\cdots(-r)\over x!}\\ &= (-1)^{x}{(-r)(-r-1)\cdots(-r-(x-1))\over x!}\\ &= (-1)^{x}{(-r)(-r-1)\cdots(-r-(x-1))(-r-x)!\over x!(-r-x)!}\\ &=(-1)^{x}{-r\choose x} \end{align*} $$

Mean

The expected value is $$\mu = E[X] = {rp\over 1-p}$$

Proof:

$$ \begin{align*} E[X] &= \sum_{x=0}^{\infty}xf(x; r, p)\\ &= \sum_{x=0}^{\infty}x{x + r-1\choose x}p^{x}(1-p)^{r}\\ &=\sum_{x=1}^{\infty}{(x+r-1)!\over(r-1)!(x-1)!}p^{x}(1-p)^{r}\\ &=\sum_{x=1}^{\infty}r{(x+r-1)!\over r(r-1)!(x-1)!}p^{x}(1-p)^{r}\\ &= {rp\over 1-p}\sum_{x=1}^{\infty}{x + r-1\choose x-1}p^{x-1}(1-p)^{r+1}\\ &={rp\over 1-p}\sum_{y=0}^{\infty}{y+(r+1)-1\choose y}p^{y}(1-p)^{r+1}\quad\quad\quad \mbox{setting}\ y= x-1\\ &= {rp\over 1-p} \end{align*} $$ where the last summation follows $Y\sim\mbox{NB}(r+1; p)$.

Variance

The variance is $$\sigma^2 = \mbox{Var}(X) = {rp\over(1-p)^2}$$

Proof:

$$ \begin{align*} E\left[X^2\right] &= \sum_{x=0}^{\infty}x^2f(x; r, p)\\ &= \sum_{x=0}^{\infty}x^2{x + r-1\choose x}p^{x}(1-p)^{r}\\ &=\sum_{x=1}^{\infty}x{(x+r-1)!\over(r-1)!(x-1)!}p^{x}(1-p)^{r}\\ &=\sum_{x=1}^{\infty}rx{(x+r-1)!\over r(r-1)!(x-1)!}p^{x}(1-p)^{r}\\ &= {rp\over 1-p}\sum_{x=1}^{\infty}x{x + r-1\choose x-1}p^{x-1}(1-p)^{r+1}\\ &={rp\over 1-p}\sum_{y=0}^{\infty}(y+1){y+(r+1)-1\choose y}p^{y}(1-p)^{r+1}\quad\quad\quad (\mbox{setting}\ y= x-1)\\ &= {rp\over 1-p}\left(\sum_{y=0}^{\infty}y{y+(r+1)-1\choose y}p^{y}(1-p)^{r+1}+\sum_{y=0}^{\infty}{y+(r+1)-1\choose y}p^{y}(1-p)^{r+1} \right)\\ &= {rp\over 1-p}\left({(r+1)p\over 1-p} + 1\right)\quad\quad\quad\quad\quad\quad(Y\sim\mbox{NB}(r+1; p),\ E[Y] = {(r+1)p\over1-p})\\ &= {rp\over 1-p}\cdot{rp+1\over 1-p} \end{align*} $$ Thus the variance is $$ \begin{align*} \mbox{Var}(X) &= E\left[X^2\right] - E[X]^2\\ &= {rp\over 1-p}\cdot{rp+1\over 1-p}- \left({rp\over 1-p}\right)^2\\ &= {rp\over 1-p}\left({rp+1\over 1-p} - {rp\over 1-p}\right)\\ &= {rp\over(1-p)^2} \end{align*} $$

Examples

1. Find the expected value and the variance of the number of times one must throw a die until the outcome 1 has occurred 4 times.

Solution:

Let $X$ be the number of times and $Y$ be the number of success in the trials. Obviously, we have $X = Y+4$. Then the problem can be rewritten as ``the expected value and the variance of the number of times one must throw a die until the outcome 1 has NOT occurred 4 times''. That is, $r = 4$, $p = {5\over 6}$ and $Y\sim\mbox{NB}(r; p)$. Thus $$E[X] = E[Y+4]= E[Y] + 4 = {rp\over 1-p}+4 = 24$$ $$\mbox{Var}(X) = \mbox{Var}(Y+4) = \mbox{Var}(Y) = {rp\over(1-p)^2}= 120$$

Reference

  1. Ross, S. (2010). A First Course in Probability (8th Edition). Chapter 4. Pearson. ISBN: 978-0-13-603313-4.
  2. Chen, H. Advanced Statistical Inference. Class Notes. PDF

基本概率分布Basic Concept of Probability Distributions 4: Negative Binomial Distribution的更多相关文章

  1. 基本概率分布Basic Concept of Probability Distributions 5: Hypergemometric Distribution

    PDF version PMF Suppose that a sample of size $n$ is to be chosen randomly (without replacement) fro ...

  2. 基本概率分布Basic Concept of Probability Distributions 1: Binomial Distribution

    PDF下载链接 PMF If the random variable $X$ follows the binomial distribution with parameters $n$ and $p$ ...

  3. 基本概率分布Basic Concept of Probability Distributions 8: Normal Distribution

    PDF version PDF & CDF The probability density function is $$f(x; \mu, \sigma) = {1\over\sqrt{2\p ...

  4. 基本概率分布Basic Concept of Probability Distributions 7: Uniform Distribution

    PDF version PDF & CDF The probability density function of the uniform distribution is $$f(x; \al ...

  5. 基本概率分布Basic Concept of Probability Distributions 6: Exponential Distribution

    PDF version PDF & CDF The exponential probability density function (PDF) is $$f(x; \lambda) = \b ...

  6. 基本概率分布Basic Concept of Probability Distributions 3: Geometric Distribution

    PDF version PMF Suppose that independent trials, each having a probability $p$, $0 < p < 1$, o ...

  7. 基本概率分布Basic Concept of Probability Distributions 2: Poisson Distribution

    PDF version PMF A discrete random variable $X$ is said to have a Poisson distribution with parameter ...

  8. PRML Chapter 2. Probability Distributions

    PRML Chapter 2. Probability Distributions P68 conjugate priors In Bayesian probability theory, if th ...

  9. Common Probability Distributions

    Common Probability Distributions Probability Distribution A probability distribution describes the p ...

随机推荐

  1. Alpha版本发布说明

    软件发布的同时,在团队博客上写一个发布说明     ▪ 列出这一版本的新功能     ▪ 这一版本修复的缺陷     ▪ 对运行环境的要求     ▪ 安装方法     ▪ 描述系统已知的问题和限制 ...

  2. TensorFlow 源代码初读感受

    把自己微博发的文章:http://www.weibo.com/1804230372/En7PdlgLb?from=page_1005051804230372_profile&wvr=6& ...

  3. byte[] 转字符串 中文乱码

    闲来无事,写了一个UWP的UDP/TCP小Demo,网上找了个网络调试助手,就兴冲冲的开始玩耍 结果“鸡同鸭讲”: 讲英文的时候大家都是abc,hello man!how are you? 讲中文的时 ...

  4. 基于DDD的.NET开发框架 - ABP的Entity设计思想

    返回ABP系列 ABP是“ASP.NET Boilerplate Project (ASP.NET样板项目)”的简称. ASP.NET Boilerplate是一个用最佳实践和流行技术开发现代WEB应 ...

  5. Replace Pioneer注册

    以下是目前合法长期使用Replace Pioneer的唯一方法(除了购买之外): Replace Pioneer过期后,会弹出一个注册(Registration)窗口,其中有一个试用选项(Trial ...

  6. [BZOJ3714][PA2014]Kuglarz(MST)

    题目: Description 魔术师的桌子上有n个杯子排成一行,编号为1,2,…,n,其中某些杯子底下藏有一个小球,如果你准确地猜出是哪些杯子,你就可以获得奖品.花费c_ij元,魔术师就会告诉你杯子 ...

  7. mybatis缓存学习笔记

    mybatis有两级缓存机制,一级缓存默认开启,可以在手动关闭:二级缓存默认关闭,可以手动开启.一级缓存为线程内缓存,二级缓存为线程间缓存. 一提缓存,必是查询.缓存的作用就是查询快.写操作只能使得缓 ...

  8. Ubuntu修改文件关联

    * 在system setting>details中可以设置一部分文件关联,很弱很破. * 右键open with只能临时选择打开方式,并且可选的打开方式十分有限.如果是自己编的程序,在列表中没 ...

  9. oracle 学习笔记

    --2.2 进入和退出oracle数据库--在windows中输入cmd打开命令窗口 然后输入 sqlplu / as sysdba--验证数据库是否安装成功 --select status from ...

  10. webpack入坑之旅(五)加载vue单文件组件

    这是一系列文章,此系列所有的练习都存在了我的github仓库中vue-webpack,在本人有了新的理解与认识之后,会对文章有不定时的更正与更新.下面是目前完成的列表: webpack入坑之旅(一)不 ...