置信区间









在统计学中,一个概率样本的置信区间英语:Confidence intervalCI),是对产生这个样本的总体的参数分布Parametric Distribution)中的某一个未知参数值,以区间形式给出的估计。相对于点估计Point Estimation)用一个样本统计量来估计参数值,置信区间还蕴含了估计的精确度的信息。在现代机器学习中越来越常用的置信集合Confidence Set)概念是置信区间在多维分析的推广[1]


置信区间在频率学派中间使用,其在贝叶斯统计中的对应概念是可信区间英语Credible intervalCredible Interval)。两者建立在不同的概念基础上的,贝叶斯统计将分布的位置参数视为随机变量,并对给定观测到的数据之后未知参数的后验分布进行描述,故无论对随机样本还是已观测数据,构造出来的可信区间,其可信水平都一个合法的概率[2];而置信区间的置信水平,只在考虑随机样本时可以被理解为一个概率。




目录






  • 1 定义


  • 2 例子


  • 3 构造法


  • 4 与参数检验的联系


  • 5 参考文献


  • 6 参考书目





定义


对随机样本的定义

定义置信区间最清晰的方式是从一个随机样本出发。考虑一个一维随机变量X{displaystyle {cal {X}}}{displaystyle {cal {X}}}服从分布F{displaystyle {cal {F}}}{displaystyle {cal {F}}},又假设θ{displaystyle theta }theta F{displaystyle {cal {F}}}{displaystyle {cal {F}}}的参数之一。假设我们的数据采集计划将要独立地抽样n{displaystyle n}n次,得到一个随机样本{X1,…,Xn}{displaystyle {X_{1},ldots ,X_{n}}}{displaystyle {X_{1},ldots ,X_{n}}},注意这里所有的Xi{displaystyle X_{i}}X_{i}都是随机的,我们是在讨论一个尚未被观测的数据集。如果存在统计量(统计量定义为样本X={X1,…,Xn}{displaystyle X={X_{1},ldots ,X_{n}}}{displaystyle X={X_{1},ldots ,X_{n}}}的一个函数,且不得依赖于任何未知参数)u(X1,…,Xn),v(X1,…,Xn){displaystyle u(X_{1},ldots ,X_{n}),v(X_{1},ldots ,X_{n})}{displaystyle u(X_{1},ldots ,X_{n}),v(X_{1},ldots ,X_{n})}满足u(X1,…,Xn)<v(X1,…,Xn){displaystyle u(X_{1},ldots ,X_{n})<v(X_{1},ldots ,X_{n})}{displaystyle u(X_{1},ldots ,X_{n})<v(X_{1},ldots ,X_{n})}使得:


P(θ(u(X1,…,Xn),v(X1,…,Xn)))=1−α{displaystyle mathbb {P} left(theta in left(u(X_{1},ldots ,X_{n}),v(X_{1},ldots ,X_{n})right)right)=1-alpha }{displaystyle mathbb {P} left(theta in left(u(X_{1},ldots ,X_{n}),v(X_{1},ldots ,X_{n})right)right)=1-alpha }

则称(u(X1,…,Xn),v(X1,…,Xn)){displaystyle left(u(X_{1},ldots ,X_{n}),v(X_{1},ldots ,X_{n})right)}{displaystyle left(u(X_{1},ldots ,X_{n}),v(X_{1},ldots ,X_{n})right)}为一个用于估计参数θ{displaystyle theta }theta 1−α{displaystyle 1-alpha }1-alpha 置信区间,其中的1−α{displaystyle 1-alpha }1-alpha 称为置信水平


对观测到的数据的定义

接续随机样本版本的定义,现在,对于随机变量X{displaystyle {cal {X}}}{displaystyle {cal {X}}}的一个已经观测到的样本{x1,…,xn}{displaystyle {x_{1},ldots ,x_{n}}}{displaystyle {x_{1},ldots ,x_{n}}},注意这里用小写x表记的xi{displaystyle x_{i}}x_{i}都是已经观测到的数字,没有随机性了,定义基于数据的1−α{displaystyle 1-alpha }1-alpha 置信区间为:


(u(x1,…,xn),v(x1,…,xn)){displaystyle left(u(x_{1},ldots ,x_{n}),v(x_{1},ldots ,x_{n})right)}{displaystyle left(u(x_{1},ldots ,x_{n}),v(x_{1},ldots ,x_{n})right)}

注意,置信区间可以是单边或者双边的,单边的置信区间中设定u=−{displaystyle u=-infty }{displaystyle u=-infty }或者v=+∞{displaystyle v=+infty }{displaystyle v=+infty },具体前者还是后者取决于所构造的置信区间的方向。


初学者常犯一个概念性错误,是将基于观测到的数据所构造的置信区间的置信水平,误认为是它包含未知参数的真实值的概率。正确的理解是:置信水平只有在描述这个构造置信区间的过程(或称方法)的意义下才能被视为一个概率。一个基于已经观测到的数据所构造出来的置信区间,其两个端点已经不再具有随机性,因此,其包含未知参数的真实值的概率是0或者1,但我们不能知道是前者还是后者[3]



例子


例1:正态分布,已知总体方差σ2{displaystyle sigma ^{2}}sigma^2

1−α{displaystyle 1-alpha }1-alpha 水平的正态置信区间为:




(x¯z1−α/2σn,x¯+z1−α/2σn){displaystyle left({bar {x}}-z_{1-alpha /2}{frac {sigma }{sqrt {n}}},{bar {x}}+z_{1-alpha /2}{frac {sigma }{sqrt {n}}}right)}{displaystyle left({bar {x}}-z_{1-alpha /2}{frac {sigma }{sqrt {n}}},{bar {x}}+z_{1-alpha /2}{frac {sigma }{sqrt {n}}}right)} (双边)


(−,x¯+z1−ασn){displaystyle left(-infty ,{bar {x}}+z_{1-alpha }{frac {sigma }{sqrt {n}}}right)}{displaystyle left(-infty ,{bar {x}}+z_{1-alpha }{frac {sigma }{sqrt {n}}}right)} (单边)


(x¯z1−ασn,+∞){displaystyle left({bar {x}}-z_{1-alpha }{frac {sigma }{sqrt {n}}},+infty right)}{displaystyle left({bar {x}}-z_{1-alpha }{frac {sigma }{sqrt {n}}},+infty right)} (单边)


以下为方便起见,只列出双边置信区间的例子,且区间中用"±{displaystyle pm }pm"进行简记:


例2:正态分布,未知总体方差σ2{displaystyle sigma ^{2}}sigma^2

1−α{displaystyle 1-alpha }1-alpha 水平的双边正态置信区间为:


(x¯±tn−1;α/2sn){displaystyle left({bar {x}}pm t_{n-1;alpha /2}{frac {s}{sqrt {n}}}right)}{displaystyle left({bar {x}}pm t_{n-1;alpha /2}{frac {s}{sqrt {n}}}right)}

例3:两个独立正态样本x{displaystyle x}xy{displaystyle y}y,样本大小为m{displaystyle m}mn{displaystyle n}n,估计总体均值之差μ1−μ2{displaystyle mu _{1}-mu _{2}}{displaystyle mu _{1}-mu _{2}},假设总体方差未知但相等:σ1=σ2{displaystyle sigma _{1}=sigma _{2}}{displaystyle sigma _{1}=sigma _{2}}(如果未知且不等就要应用Welch公式英语Welch's t-test来确定t分布的自由度)

1−α{displaystyle 1-alpha }1-alpha 水平的双边正态置信区间为:



(x¯±tm+n−2;α/2⋅sp⋅1m+1n){displaystyle left({bar {x}}-{bar {y}}pm t_{m+n-2;alpha /2}cdot s_{p}cdot {sqrt {{frac {1}{m}}+{frac {1}{n}}}}right)}{displaystyle left({bar {x}}-{bar {y}}pm t_{m+n-2;alpha /2}cdot s_{p}cdot {sqrt {{frac {1}{m}}+{frac {1}{n}}}}right)},其中sp=(m−1)sx2+(n−1)sy2m+n−2{displaystyle s_{p}={sqrt {frac {(m-1)s_{x}^{2}+(n-1)s_{y}^{2}}{m+n-2}}}}{displaystyle s_{p}={sqrt {frac {(m-1)s_{x}^{2}+(n-1)s_{y}^{2}}{m+n-2}}}}sx,sy{displaystyle s_{x},s_{y}}{displaystyle s_{x},s_{y}}分别表示x{displaystyle x}xy{displaystyle y}y的样本标准差。


构造法


一般来说,置信区间的构造需要先找到一个枢轴变量Pivotal quantity,或称Pivot),其表达式依赖于样本以及带估计的未知参数(但不能依赖于总体的其它未知参数),其分布不依赖于任何未知参数。


下面以上述例2为例,说明如何利用枢轴变量构造置信区间。对于一个正态分布的随机样本X1,…,Xn{displaystyle {X_{1},ldots ,X_{n}}}{displaystyle {X_{1},ldots ,X_{n}}},可以证明(此证明对初学者并不容易)如下统计量互相独立



=1n∑i=1nXi{displaystyle {bar {X}}={frac {1}{n}}sum _{i=1}^{n}X_{i}}{displaystyle {bar {X}}={frac {1}{n}}sum _{i=1}^{n}X_{i}}S2=∑i=1n(Xi−)2n−1{displaystyle S^{2}={frac {sum _{i=1}^{n}left(X_{i}-{bar {X}}right)^{2}}{n-1}}}{displaystyle S^{2}={frac {sum _{i=1}^{n}left(X_{i}-{bar {X}}right)^{2}}{n-1}}}

它们的分布是:



μσN(0,1){displaystyle {frac {{bar {X}}-mu }{sigma }}sim N(0,1)}{displaystyle {frac {{bar {X}}-mu }{sigma }}sim N(0,1)}S2σ2∼χn−12{displaystyle {frac {S^{2}}{sigma ^{2}}}sim chi _{n-1}^{2}}{displaystyle {frac {S^{2}}{sigma ^{2}}}sim chi _{n-1}^{2}}

所以根据t分布的定义,有


t=X¯μS2∼tn−1{displaystyle t={frac {{bar {X}}-mu }{sqrt {S^{2}}}}sim t_{n-1}}{displaystyle t={frac {{bar {X}}-mu }{sqrt {S^{2}}}}sim t_{n-1}}

于是反解如下等式左边括号中的不等式


P(−tn−1;α/2<t=X¯μS2<tn−1;α/2)=1−α{displaystyle mathbb {P} left(-t_{n-1;alpha /2}<t={frac {{bar {X}}-mu }{sqrt {S^{2}}}}<t_{n-1;alpha /2}right)=1-alpha }{displaystyle mathbb {P} left(-t_{n-1;alpha /2}<t={frac {{bar {X}}-mu }{sqrt {S^{2}}}}<t_{n-1;alpha /2}right)=1-alpha }

就得到了例2中双边置信区间的表达式。



与参数检验的联系


有时,置信区间可以用来进行参数检验。例如在上面的例1中构造的双边1−α{displaystyle 1-alpha }1-alpha 水平置信区间,可以用来检验具有相应的显著水平为α{displaystyle alpha }alpha 双边对立假设,具体地说是如下检验:
正态分布总体,知道总体方差σ2{displaystyle sigma ^{2}}sigma^2α{displaystyle alpha }alpha 显著水平下检验:



H0:μ0{displaystyle H_{0}:mu =mu _{0}}{displaystyle H_{0}:mu =mu _{0}} vs H1:μμ0{displaystyle H_{1}:mu neq mu _{0}}{displaystyle H_{1}:mu neq mu _{0}}

检验方法是:当且仅当相应的1−α{displaystyle 1-alpha }1-alpha 水平置信区间不包含μ0{displaystyle mu _{0}}mu _{0}时拒绝零假设H0{displaystyle H_{0}}H_0


例1中构造的双边1−α{displaystyle 1-alpha }1-alpha 水平置信区间也可以用来检验如下两个显著水平为α/2{displaystyle alpha /2}{displaystyle alpha /2}单边对立假设:



H0:μμ0{displaystyle H_{0}:mu leq mu _{0}}{displaystyle H_{0}:mu leq mu _{0}} vs H1:μ0{displaystyle H_{1}:mu >mu _{0}}{displaystyle H_{1}:mu >mu _{0}}




H0:μμ0{displaystyle H_{0}:mu geq mu _{0}}{displaystyle H_{0}:mu geq mu _{0}} vs H1:μ0{displaystyle H_{1}:mu <mu _{0}}{displaystyle H_{1}:mu <mu _{0}}

检验方法是完全类似的,比如对于上述第一个单边检验H1:μ0{displaystyle H_{1}:mu >mu _{0}}{displaystyle H_{1}:mu >mu _{0}},当且仅当双边置信区间的左端点大于μ0{displaystyle mu _{0}}mu _{0}时拒绝零假设。



参考文献





  1. ^ Brittany Terese Fasy; Fabrizio Lecci; Alessandro Rinaldo; Larry Wasserman; Sivaraman Balakrishnan; Aarti Singh. Confidence sets for persistence diagrams. The Annals of Statistics. 2014, 42 (6): 2301–2339. 


  2. ^ Box, George EP; Tiao, George C. Bayesian inference in statistical analysis. John Wiley & Sons. 2011. 


  3. ^ Moore, D; McCabe, George P; Craig, B. Introduction to the Practice of Statistics. San Francisco, CA: Freeman. 2012. 




参考书目


.mw-parser-output .refbegin{font-size:90%;margin-bottom:0.5em}.mw-parser-output .refbegin-hanging-indents>ul{list-style-type:none;margin-left:0}.mw-parser-output .refbegin-hanging-indents>ul>li,.mw-parser-output .refbegin-hanging-indents>dl>dd{margin-left:0;padding-left:3.2em;text-indent:-3.2em;list-style:none}.mw-parser-output .refbegin-100{font-size:100%}



  • 羅納德·費雪 (1956) Statistical Methods and Scientific Inference. Oliver and Boyd, Edinburgh. (See p. 32.)

  • 弗罗因德 (1962) Mathematical Statistics Prentice Hall, Englewood Cliffs, NJ. (See pp. 227–228.)


  • 伊安·海金 (1965) Logic of Statistical Inference. Cambridge University Press, Cambridge

  • 齐平 (1962) Introduction to Statistical Inference. D. Van Nostrand, Princeton, NJ.


  • 杰克·基弗(1977) "Conditional Confidence Statements and Confidence Estimators (with discussion)" Journal of the American Statistical Association, 72, 789–827.


  • 泽西·内曼 (1937) "Outline of a Theory of Statistical Estimation Based on the Classical Theory of Probability" Philosophical Transactions of the Royal Society of London A, 236, 333–380. (Seminal work.)

  • G.K.罗宾逊 (1975) "Some Counterexamples to the Theory of Confidence Intervals." Biometrika, 62, 155–161.







Comments

Popular posts from this blog

Information security

章鱼与海女图

Farm Security Administration