Proofs related to chi-squared distribution

From testwiki
Jump to navigation Jump to search

Template:Main articleTemplate:Unreferenced The following are proofs of several characteristics related to the chi-squared distribution.

Derivations of the pdf

Derivation of the pdf for one degree of freedom

Let random variable Y be defined as Y = X2 where X has normal distribution with mean 0 and variance 1 (that is X ~ N(0,1)).

Then,
fory<0,FY(y)=P(Y<y)=0andfory≥0,FY(y)=P(Y<y)=P(X2<y)=P(|X|<y)=P(−y<X<y)=FX(y)−FX(−y)=FX(y)−(1−FX(y))=2FX(y)−1

fY(y)=ddyFY(y)=2ddyFX(y)−0=2ddy(∫−∞y12πe−t22dt)=212πe−y2(y)'y=212πe−y2(12y−12)=1212Γ(12)y−12e−y2

Where F and f are the cdf and pdf of the corresponding random variables.

Then Y=X2∼χ12.

Alternative proof directly using the change of variable formula

The change of variable formula (implicitly derived above), for a monotonic transformation y=g(x), is:

fY(y)=∑ifX(gi−1(y))|dgi−1(y)dy|.

In this case the change is not monotonic, because every value of Y has two corresponding values of X (one positive and negative). However, because of symmetry, both halves will transform identically, i.e.

fY(y)=2fX(g−1(y))|dg−1(y)dy|.

In this case, the transformation is: x=g−1(y)=y, and its derivative is dg−1(y)dy=12y.

So here:

fY(y)=212πe−y/212y=12πye−y/2.

And one gets the chi-squared distribution, noting the property of the gamma function: Γ(1/2)=π.

Derivation of the pdf for two degrees of freedom

There are several methods to derive chi-squared distribution with 2 degrees of freedom. Here is one based on the distribution with 1 degree of freedom.

Suppose that X and Y are two independent variables satisfying X∼χ12 and Y∼χ12, so that the probability density functions of X and Y are respectively:

fX(x)=1212Γ(12)x−12e−x2

and of course fY(y)=fX(y). Then, we can derive the joint distribution of (X,Y):

f(x,y)=fX(x)fY(y)=12π(xy)−12e−x+y2

where Γ(12)2=π. FurtherTemplate:Clarify, let A=xy and B=x+y, we can get that:

x=B+B2−4A2

and

y=B−B2−4A2

or, inversely

x=B−B2−4A2

and

y=B+B2−4A2

Since the two variable change policies are symmetric, we take the upper one and multiply the result by 2. The Jacobian determinant can be calculated asTemplate:Clarify:

Jacobian⁡(x,yA,B)=|−(B2−4A)−121+B(B2−4A)−122(B2−4A)−121−B(B2−4A)−122|=−(B2−4A)−12


Now we can change f(x,y) to f(A,B)Template:Clarify:

f(A,B)=2×12πA−12e−B2(B2−4A)−12

where the leading constant 2 is to take both the two variable change policies into account. Finally, we integrate out ATemplate:Clarify to get the distribution of B, i.e. x+y:

f(B)=2×e−B22π∫0B24A−12(B2−4A)−12dA

Substituting A=B24sin2(t) gives:

f(B)=2×e−B22π∫0π2dt

So, the result is:

f(B)=e−B22

Derivation of the pdf for k degrees of freedom

Consider the k samples xi to represent a single point in a k-dimensional space. The chi square distribution for k degrees of freedom will then be given by:

P(Q)dQ=∫𝒱∏i=1k(N(xi)dxi)=∫𝒱e−(x12+x22+⋯+xk2)/2(2π)k/2dx1dx2⋯dxk

where N(x) is the standard normal distribution and 𝒱 is that elemental shell volume at Q(x), which is proportional to the (k − 1)-dimensional surface in k-space for which

Q=∑i=1kxi2

It can be seen that this surface is the surface of a k-dimensional ball or, alternatively, an n-sphere where n = k - 1 with radius R=Q, and that the term in the exponent is simply expressed in terms of Q. Since it is a constant, it may be removed from inside the integral.

P(Q)dQ=e−Q/2(2π)k/2∫𝒱dx1dx2⋯dxk

The integral is now simply the surface area A of the (k − 1)-sphere times the infinitesimal thickness of the sphere which is

dR=dQ2Q1/2.

The area of a (k − 1)-sphere is:

A=2Rk−1πk/2Γ(k/2)

Substituting, realizing that Γ(z+1)=zΓ(z), and cancelling terms yields:

P(Q)dQ=e−Q/2(2π)k/2AdR=12k/2Γ(k/2)Qk/2−1e−Q/2dQ