为方差创建置信区间时为什么使用卡方?


15

这是一个非常基本的问题。为什么我们使用卡方分布?这种分布是什么意思?为什么将这种分布用于创建方差的置信区间?

我用Google搜索的每个地方都只是说明了一个事实,说明了何时使用chi,但没有说明为什么要使用chi,以及为什么会使用它。

非常感谢任何可以将我引向正确方向的人,也就是-真正理解我为方差创建置信区间时为什么使用chi的原因。


4
使用它是因为-当数据正常时Q=(n−1)s2σ2∼χn−12。(这使Q成为关键数量)
— Glen_b-恢复莫妮卡


1
对于那些谁感兴趣的或进一步的研究应用到χ2,你将要讲究之间的区别χ2(“卡方”)分布和χ(“气”)分布(它是平方根的χ2,不出所料)。
— ub

Answers:


23

快速回答

其理由是因为,假设数据是独立同分布和Xi∼N(μ,σ2),并限定

X¯=∑NXiNS2=∑N(X¯−Xi)2N−1
形成置信区间的情况下,与所述样本方差(相关联的采样分布S2!,记住,一个随机变量)是卡方分布(S2(N−1)/σ2∼χn−12),就像用样本均值相关联的抽样分布是一个标准的正态分布((X¯−μ)n/σ∼Z(0,1)),当你知道的方差,并且与当你不叔学生((X¯−μ)n/S∼Tn−1)。

长答案

首先,我们将证明,S2(N−1)/σ2如下与卡方分布N−1自由度。之后,我们将看到该证明在推导方差的置信区间时如何有用,以及卡方分布如何显示(以及为什么如此有用!)。让我们开始。

证据

为此,也许您必须习惯此Wikipedia文章中的卡方分布。这个分布仅仅具有一个参数:自由度,的,并碰巧具有矩生成函数(MGF)由下式给出: 米χ 2 ν(吨)= (1 - 2 吨)- ν / 2。 如果我们能表明的分布小号2(Ñ - 1 )/ σ 2具有像这样的一个时刻生成函数,但与ν =ν

mχν2(t)=(1−2t)−ν/2.
S2(N−1)/σ2,则我们已经表明,小号2(Ñ - 1 )/ σ 2如下与卡方分布 ñ - 1个自由度。为了显示这一点,请注意两个事实:ν=N−1S2(N−1)/σ2N−1
  1. 如果我们定义, 其中ž我〜Ñ(0,1),即,标准正态随机变量,瞬间生成函数ý由下式给出 米ý(吨)

    Y=∑(Xi−X¯)2σ2=∑Zi2,
    Zi∼N(0,1)YZ2 的MGF由 m Z 2(t )给出
    米ÿ(Ť)=Ë[ËŤÿ]=Ë[ËŤž1个2]×Ë[ËŤž22]×。。。Ë[ËŤžñ2]=米ž一世2(Ť)×米ž22(Ť)×。。。米žñ2(Ť)。
    ž2 其中,我已经使用标准正态,的PDF˚F(ż)=ë- ž 2 / 2/√
    mZ2(t)=∫−∞∞f(z)exp⁡(tz2)dz=(1−2t)−1/2,
    ,因此, 米ÿ(吨)=(1-2吨) - ñ / 2, 这意味着ý如下与卡方分布Ñ自由度。f(z)=e−z2/2/2π
    mY(t)=(1−2t)−N/2,
    YN
  2. Y1Y2ν1ν2W=Y1+Y2ν1+ν2W

N−1

(N−1)S2=−n(X¯−μ)+∑(Xi−μ)2,
σ2 注意,该和的左侧的第二项以具有1个自由度的卡方分布分布,而右侧的和以具有N个自由度的卡方分布。因此,š2(Ñ-1)/σ2分配作为卡方与ñ-1个自由度。
(N−1)S2σ2+(X¯−μ)2σ2/N=∑(Xi−μ)2σ2.
NS2(N−1)/σ2N−1

计算方差的置信区间。

L1L2

P(L1≤σ2≤L2)=1−α.
S2(N−1)
L1S2(N−1)≤σ2S2(N−1)≤L2S2(N−1).
S2(N−1)/σ2N−1
L1S2(N−1)≤σ2S2(N−1)⇒S2(N−1)σ2≤S2(N−1)L1,σ2S2(N−1)≤L2S2(N−1)⇒S2(N−1)L2≤S2(N−1)σ2,
P(S2(N−1)L2≤S2(N−1)σ2≤S2(N−1)L1)=1−α.
S2(N−1)/σ2∼χ2(N−1)
∫S2(N−1)L2N−1pχ2(x)dx=(1−α)/2   ,∫N−1S2(N−1)L1pχ2(x)dx=(1−α)/2  
(we integrate up to N−1 because the expected value of a chi-squared random variable with N−1 degrees of freedom is N−1) or, equivalently,
∫0S2(N−1)L2pχ2(x)dx=α/2,∫S2(N−1)L1∞pχ2(x)dx=α/2.
Calling χα/22=S2(N−1)L2 and χ1−α/22=S2(N−1)L1, where the values χα/22 and χ1−α/22 can be found in chi-square tables (in computers mainly!) and solving for L1 and L2,
L1=S2(N−1)χ1−α/22,L2=S2(N−1)χα/22.
Hence, your confidence interval for the variance is
C.I.=(S2(N−1)χ1−α/22,S2(N−1)χα/22).

1
Simply because S2 does not follow a centered chi-square distribution, while S2(N−1)/σ2 does and, therefore, its easier to work with. Are you asking for a derivation for that? (i.e., you want someone to show you that S2(N−1)/σ2 follows a chi-square distribution with N−1 degrees of freedom?)
— Néstor

4
修改此答案以包含非常强的但未陈述的假设(当基础数据独立且服从正态分布时样本方差遵循卡方分布)将很有帮助。与样本均值的分布理论不同,在实践中,样本均值的分布在许多情况下将近似于正态到合理的准确度,而样本方差往往不会发生相同的渐近行为(直到样本数量变得非常大)。
— ub

1
Oops. So, so true! This actually came from a problem solution that I handed out to some students, where I state on the question all these assumptions. I edited the answer now.
— 内斯托尔·

1
@user34756 The reason we don't use the distribution of S2 directly is that its distribution depends on the value of a parameter. You may find it useful to investigate the use of pivotal quantities in constructing confidence intervals.
— Glen_b-恢复莫妮卡

1
Isn't f(z)=e−z2/2 instead of f(z)=e−z2 ?
— 贝诺·莱加特2014年
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.