基本概率分布Basic Concept of Probability Distributions 4: Negative Binomial Distribution
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
- Ross, S. (2010). A First Course in Probability (8th Edition). Chapter 4. Pearson. ISBN: 978-0-13-603313-4.
- Chen, H. Advanced Statistical Inference. Class Notes. PDF
基本概率分布Basic Concept of Probability Distributions 4: Negative Binomial Distribution的更多相关文章
- 基本概率分布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 ...
- 基本概率分布Basic Concept of Probability Distributions 1: Binomial Distribution
PDF下载链接 PMF If the random variable $X$ follows the binomial distribution with parameters $n$ and $p$ ...
- 基本概率分布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 ...
- 基本概率分布Basic Concept of Probability Distributions 7: Uniform Distribution
PDF version PDF & CDF The probability density function of the uniform distribution is $$f(x; \al ...
- 基本概率分布Basic Concept of Probability Distributions 6: Exponential Distribution
PDF version PDF & CDF The exponential probability density function (PDF) is $$f(x; \lambda) = \b ...
- 基本概率分布Basic Concept of Probability Distributions 3: Geometric Distribution
PDF version PMF Suppose that independent trials, each having a probability $p$, $0 < p < 1$, o ...
- 基本概率分布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 ...
- PRML Chapter 2. Probability Distributions
PRML Chapter 2. Probability Distributions P68 conjugate priors In Bayesian probability theory, if th ...
- Common Probability Distributions
Common Probability Distributions Probability Distribution A probability distribution describes the p ...
随机推荐
- ReactNative真机运行运行
注意在iOS设备上运行React Native应用需要一个Apple Developer account并且把你的设备注册为测试设备.本向导只包含React Native相关的主题. 译注:从XCod ...
- java中String、StringBuffer、StringBuilder的区别
java中String.StringBuffer.StringBuilder是编程中经常使用的字符串类,他们之间的区别也是经常在面试中会问到的问题.现在总结一下,看看他们的不同与相同. 1.可变与不可 ...
- PRML读书会第五章 Neural Networks(神经网络、BP误差后向传播链式求导法则、正则化、卷积网络)
主讲人 网神 (新浪微博:@豆角茄子麻酱凉面) 网神(66707180) 18:55:06 那我们开始了啊,前面第3,4章讲了回归和分类问题,他们应用的主要限制是维度灾难问题.今天的第5章神经网络的内 ...
- Theano2.1.10-基础知识之循环
来自:http://deeplearning.net/software/theano/tutorial/loop.html loop 一.Scan 一个递归的通常的形式,可以用来作为循环语句. 约间和 ...
- [MCSM]伪随机数和伪随机数生成器
1. 几个问题 为什么需要随机数? 伪随机数伪在哪里? 为何要采用伪随机数代替随机数?这种代替是否有不利影响? 如何产生(伪)随机数? 以下内容将围绕这几个问题依次说明. 2. 参考 http://e ...
- spring boot/cloud 应用监控
应用的监控功能,对于分布式系统非常重要.如果把分布式系统比作整个社会系统.那么各个服务对应社会中具体服务机构,比如银行.学校.超市等,那么监控就类似于警察局和医院,所以其重要性显而易见.这里说的,监控 ...
- JVM内存管理------JAVA语言的内存管理概述
引言 内存管理一直是JAVA语言自豪与骄傲的资本,它让JAVA程序员基本上可以彻底忽略与内存管理相关的细节,只专注于业务逻辑.不过世界上不存在十全十美的好事,在带来了便利的同时,也因此引入了很多令人抓 ...
- 如果在敲代码的时候eclipse不弹出提示,怎么办?
非常弱智的操作,我们曾经在输入System.out.println("content");的时候,当我们输入了"."之后,在输入错误,此时我们再回退至" ...
- Spring学习进阶(二)Spring IoC
在使用Spring所提供的各种丰富而神奇的功能之前,必须在Spring IoC容器中装配好Bean,并建立Bean与Bean之间的关联关系.控制反转(Inverser of Control ioc)是 ...
- 【Alpha版本】冲刺阶段——Day 4
我说的都队 031402304 陈燊 031402342 许玲玲 031402337 胡心颖 03140241 王婷婷 031402203 陈齐民 031402209 黄伟炜 031402233 郑扬 ...