Por que o qui quadrado é usado ao criar um intervalo de confiança para a variação?


15

Esta é uma pergunta muito básica. Por que usamos uma distribuição chi square? Qual o significado dessa distribuição? Por que essa distribuição é usada para criar um intervalo de confiança para a variação?

Todos os lugares em que procuro uma explicação no Google apenas apresentam esse fato, explicando quando usar o chi, mas não explicando por que usar o chi e por que ela tem a mesma aparência.

Muito obrigado a qualquer um que possa me indicar a direção certa e que seja - realmente entendendo por que estou usando o chi quando estou criando um intervalo de confiança para a variação.


4
Você o usa porque - quando os dados são normais - Q=(n−1)s2σ2∼χn−12 . (Isto faz com queQuma quantidade essencial)
— Glen_b -Reinstate Monica

2
Consulte também stats.stackexchange.com/questions/15711/… e seus links.
— Nick Cox

11
Para aqueles interessados ​​nas aplicações de ou em pesquisas adicionais sobre χ2 , você deve prestar atenção à distinção entre uma distribuição de χ2 ("qui-quadrado") e uma distribuição de χ ("qui") (é o raiz quadrada de um χ2 , sem surpresa).
— whuber

Respostas:


23

Resposta rápida

O motivo é que, assumindo que os dados são iid e e definindo ˉ XXi∼N(μ,σ2) ao formar intervalos de confiança, a distribuição da amostra associada à variância da amostra (S2, lembre-se, uma variável aleatória!) É uma distribuição qui-quadrado (S2(N-1)/σ2∼χ2n-1), assim como a distribuição da amostra associada à média da amostra é uma distribuição normal padrão ((ˉX-μ)√

X¯=∑NXiNS2=∑N(X¯−Xi)2N−1
S2S2(N−1)/σ2∼χn−12) quando você conhece a variação, e com um aluno t quando você não (( ˉ X -μ) √(X¯−μ)n/σ∼Z(0,1) ).(X¯−μ)n/S∼Tn−1

Resposta longa

Primeiramente, provaremos que segue uma distribuição qui-quadrado com N - 1S2(N−1)/σ2N−1 graus de liberdade. Depois disso, veremos como essa prova é útil ao derivar os intervalos de confiança para a variação e como a distribuição do qui-quadrado aparece (e por que é tão útil!). Vamos começar.

A prova

Para isso, talvez você precise se acostumar com a distribuição do qui-quadrado neste artigo da Wikipedia . Essa distribuição possui apenas um parâmetro: os graus de liberdade, , e passa a ter uma Função Geradora de Momento (MGF) dada por: m χ 2 ν ( t ) = ( 1 - 2 t ) - ν / 2 . Se pudermos mostrar que a distribuição de S 2 ( N - 1 ) / σ 2 tem uma função geradora de momentos como esta, mas com ν Nν

mχν2(t)=(1−2t)−ν/2.
S2(N−1)/σ2 , mostramos que S 2 ( N - 1 ) / σ 2 segue uma distribuição qui-quadrado com N - 1 graus de liberdade. Para mostrar isso, observe dois fatos:ν=N−1S2(N−1)/σ2N−1
  1. Se definirmos, ondeZi~N(0,1), isto é, variáveis aleatória normal, a função de geração de momento deYé dada por m Y (t)

    Y=∑(Xi−X¯)2σ2=∑Zi2,
    Zi∼N(0,1)Y
    mY(t)=E[etY]=E[etZ12]×E[etZ22]×...E[etZN2]=mZi2(t)×mZ22(t)×...mZN2(t).
    The MGF of Z2 is given by
    mZ2(t)=∫−∞∞f(z)exp⁡(tz2)dz=(1−2t)−1/2,
    where I have used the PDF of the standard normal, f(z)=e−z2/2/2π and, hence,
    mY(t)=(1−2t)−N/2,
    which implies that Y follows a chi-square distribution with N degrees of freedom.
  2. Y1Y2ν1ν2 degrees of freedom, then W=Y1+Y2 distributes with a chi-square distribution with ν1+ν2 degrees of freedom (this follows from taking the MGF of W; do this!).

With the above facts, note that if you multiply the sample variance by N−1, you obtain (after some algebra),

(N−1)S2=−n(X¯−μ)+∑(Xi−μ)2,
and, hence, dividing by σ2,
(N−1)S2σ2+(X¯−μ)2σ2/N=∑(Xi−μ)2σ2.
Note that the second term in the left-side of this sum distributes as a chi-square distribution with 1 degree of freedom, and the right-hand side sum distributes as a chi-square with N degrees of freedom. Therefore, S2(N−1)/σ2 distributes as a chi-square with N−1 degrees of freedom.

Calculating the Confidence Interval for the variance.

When looking for a confidence interval for the variance, you want to know the limits L1 and L2 in

P(L1≤σ2≤L2)=1−α.
Let's play with the inequality inside the parenthesis. First, divide by S2(N−1),
L1S2(N−1)≤σ2S2(N−1)≤L2S2(N−1).
And then remember two things: (1) the statistic S2(N−1)/σ2 has a chi-squared distribution with N−1 degrees of freedom and (2) the variances is always greather than zero, which implies that you can invert the inequalities, because
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,
hence, the probability we are looking for is:
P(S2(N−1)L2≤S2(N−1)σ2≤S2(N−1)L1)=1−α.
Note that S2(N−1)/σ2∼χ2(N−1). We want then,
∫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
It would be helpful to modify this answer to include the very strong but unstated assumption that the sample variance follows a chi-squared distribution when the underlying data are independent and follow a normal distribution. Unlike the theory of the distribution of the sample mean, where in practice its sampling distribution will be approximately Normal to reasonable accuracy in many situations, this same asymptotic behavior tends not to happen with the sample variance (until sample sizes become extremely large).
— whuber

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.
— Néstor

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 -Reinstate Monica

1
Isn't f(z)=e−z2/2 instead of f(z)=e−z2 ?
— Benoît Legat
Ao utilizar nosso site, você reconhece que leu e compreendeu nossa Política de Cookies e nossa Política de Privacidade.
Licensed under cc by-sa 3.0 with attribution required.