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. TF400916错误修复办法

    在使用TFS作为研发过程管理工具的时候,如果调整了工作项的状态信息,可能会出现下面的错误: 要解决此问题非常简单: 1.找一台安装了VS2015程序的环境.因为我们使用的是TFS2015,所以需要对应 ...

  2. iptables实现负载均衡

    例子: iptables -t nat -A PREROUTING -d 10.192.0.65/32 -p tcp -m tcp --dport 8080 -m statistic --mode n ...

  3. lecture6-mini批量梯度训练及三个加速的方法

    Hinton的第6课,这一课中最后的那个rmsprop,关于它的资料,相对较少,差不多除了Hinton提出,没论文的样子,各位大大可以在这上面研究研究啊. 一.mini-批量梯度下降概述 这部分将介绍 ...

  4. 为什么Javascript中的基本类型能调用方法?

    我们从一道笔试题说起: var str = 'string'; str.pro = 'hello'; console.log(str.pro + 'world'); 输出啥?要理解这个问题,我们得从头 ...

  5. PHP核心编程知识点

    一.PHP基本语法 PHP标记:一共有四种,只推荐使用第一种 语句结束符:分号 注释:行注释(//  #)和块注释(/*   */),注释的规范 二.常见的输出语句 print echo var_du ...

  6. denounce函数:Javascript中如何应对高频触发事件

    在DOM Event的世界中,以scroll.resize.mouseover等为代表的高频触发事件显得有些与众不同.通常,DOM事件只有在明确的时间点才会被触发,比如被点击,比如XMLHttpReq ...

  7. 理解IEnumerator+IEnumerable这种接口思想

    前言 本文不想过多篇幅来介绍IEnumerator和IEnumerable这两个接口的具体说明,只是把它作一个例子作引言而已,本文将根据自己的理解来描述微软为何要这样设计这种关联风格的接口.这种风格的 ...

  8. Sentinel-Redis高可用方案(一):主从复制

    引言 大概是因为Redis是个人开发的产品,所以Redis的高可用方案是被分成了几块来实现:主从复制.主从切换以及虚拟IP或客户端方案. 从Redis 2.8开始加入对Sentinel机制从而实现了服 ...

  9. C++11异常处理 noexcept

    1.简介 在C语言中,如果程序的运行出现异常.错误,我们想提供方案处理这些异常时,我们面临许多问题,如: (1)C语言没有提供统一(标准)的方式来处理错误: (2)无法保证错误会被正确的处理: (3) ...

  10. 怎样设置Word下次打开时跳转到上次阅读的位置

    ①我们启动Word2013,打开需要阅读的文档,当阅读完毕之后,在指定位置键入一个空格,然后按下Delete键删除,这样相当于是没有作任何更改. ②保存文档,单击文件--另存为,选择好路径,将文档保存 ...