Chi-squared distribution.
Suppose we have independent standard normal random variables Z 1 , . . . Z n Z_1, ... Z_n Z 1 , ... Z n , then the sum of their squares form a χ \chi χ -squared distribution with n n n degree of freedom.
Let's consider the degree of freedom equals 1 1 1 .
The standard normal distribution has the following pdf:
f ( x ) = 1 2 π exp ( − x 2 2 ) f(x) = \frac{1}{\sqrt{2\pi}} \exp(-\frac{x^2}{2}) f ( x ) = 2 π 1 exp ( − 2 x 2 )
Then the χ \chi χ -squared distribution will have the following pdf:
f ( x ) = 1 2 π x − 1 / 2 exp ( − x 2 ) f(x) = \frac{1}{\sqrt{2\pi}}x^{-1/2} \exp(-\frac{x}{2}) f ( x ) = 2 π 1 x − 1/2 exp ( − 2 x )
Now, let's consider the moment generating function:
M X ( t ) = E [ exp ( X t ) ] = ∫ 0 ∞ 1 2 π x − 1 / 2 exp ( ( t − 1 / 2 ) x ) d x M_X(t) = \mathbb{E}[\exp(Xt)] = \int_0^{\infty} \frac{1}{\sqrt{2\pi}}x^{-1/2} \exp((t-1/2)x) \, dx M X ( t ) = E [ exp ( X t )] = ∫ 0 ∞ 2 π 1 x − 1/2 exp (( t − 1/2 ) x ) d x
∫ 0 ∞ 1 2 π x − 1 / 2 exp ( ( t − 1 / 2 ) x ) d x \int_0^{\infty} \frac{1}{\sqrt{2\pi}}x^{-1/2} \exp((t-1/2)x) \, dx ∫ 0 ∞ 2 π 1 x − 1/2 exp (( t − 1/2 ) x ) d x
Let u = ( t − 1 / 2 ) x u=(t-1/2)x u = ( t − 1/2 ) x , d x = ( t − 1 / 2 ) − 1 d u dx = (t-1/2)^{-1} du d x = ( t − 1/2 ) − 1 d u , which we will have
( t − 1 / 2 ) 1 / 2 ( t − 1 / 2 ) − 1 ∫ 0 ∞ 1 2 π u − 1 / 2 exp ( u ) d u (t-1/2)^{1/2}(t-1/2)^{-1} \int_0^{\infty} \frac{1}{\sqrt{2\pi}}u^{-1/2} \exp(u)\, du ( t − 1/2 ) 1/2 ( t − 1/2 ) − 1 ∫ 0 ∞ 2 π 1 u − 1/2 exp ( u ) d u
= ( t − 1 / 2 ) − 1 / 2 = (t-1/2)^{-1/2} = ( t − 1/2 ) − 1/2
And so X = Z 1 2 + Z 2 2 + . . . + Z n 2 X =Z_1^2 +Z_2^2+...+Z_n^2 X = Z 1 2 + Z 2 2 + ... + Z n 2 will have MGF ( t − 1 / 2 ) − n / 2 (t-1/2)^{-n/2} ( t − 1/2 ) − n /2 .
In a different post, we will be showing how we can get PDF from MGF using inverse Laplace transform.
We can easily get the variance and mean
E [ X ] = ∑ i E [ Z i 2 ] = n \mathbb{E}[X] = \sum_i\mathbb{E}[Z_i^2]=n E [ X ] = i ∑ E [ Z i 2 ] = n
Var [ X ] = n Var [ Z 1 ] = n \operatorname{Var}[X] = n \operatorname{Var}[Z_1] = n Var [ X ] = n Var [ Z 1 ] = n
Theorem. Let X 1 , … , X n ∼ N ( μ , σ 2 ) X_1, \ldots, X_n \sim N\left(\mu, \sigma^2\right) X 1 , … , X n ∼ N ( μ , σ 2 ) be a random sample, then X ˉ \bar{X} X ˉ and S 2 S^2 S 2 are independent, and
( n − 1 ) S 2 σ 2 ∼ χ n − 1 2 \frac{(n-1) S^2}{\sigma^2} \sim \chi_{n-1}^2 σ 2 ( n − 1 ) S 2 ∼ χ n − 1 2
Here, X ˉ = 1 n ∑ i X i \bar{X} = \frac{1}{n}\sum_i X_i X ˉ = n 1 ∑ i X i is the sample mean and S 2 = 1 n − 1 ∑ i ( X i − X ˉ ) 2 S^2 = \frac{1}{n-1}\sum_i (X_i-\bar{X})^2 S 2 = n − 1 1 ∑ i ( X i − X ˉ ) 2 is the sample variance.
Lemma. If X 1 , … , X n ∼ N ( μ , σ 2 ) X_1, \ldots, X_n \sim N\left(\mu, \sigma^2\right) X 1 , … , X n ∼ N ( μ , σ 2 ) is a random sample, then X ˉ \bar{X} X ˉ is independent of X i − X ˉ X_i-\bar{X} X i − X ˉ for all i = 1 , … , n i=1, \ldots, n i = 1 , … , n .
Let's consider the joint pdf:
1 ( 2 π ) n / 2 σ n exp ( − 1 2 σ 2 ∑ i ( x i − μ ) 2 ) \frac{1}{(2\pi)^{n/2}\sigma^n} \exp\left(-\frac{1}{2\sigma^2}\sum_{i}(x_i-\mu)^2\right) ( 2 π ) n /2 σ n 1 exp ( − 2 σ 2 1 i ∑ ( x i − μ ) 2 )
Consider the following transformation:
X ˉ = Y 1 , X 2 − X ˉ = Y 2 , X 3 − X ˉ = Y 3 , . . . , X n − X ˉ = Y n . \bar{X} = Y_1, X_2 -\bar{X} = Y_2, X_3 -\bar{X} = Y_3, ..., X_n - \bar{X} = Y_n. X ˉ = Y 1 , X 2 − X ˉ = Y 2 , X 3 − X ˉ = Y 3 , ... , X n − X ˉ = Y n .
So X 1 = n X ˉ − X 2 − X 3 − . . . − X n = Y 1 − Y 2 − Y 3 . . . − Y n , X 2 = Y 1 + Y 2 , X 3 = Y 1 + Y 3 , . . . , X n = Y 1 + Y n . X_1 = n\bar{X}-X_2 -X_3-...-X_n = Y_1 - Y_2 - Y_3...-Y_n, X_2 = Y_1+Y_2 , X_3 = Y_1+Y_3, ..., X_n = Y_1 + Y_n. X 1 = n X ˉ − X 2 − X 3 − ... − X n = Y 1 − Y 2 − Y 3 ... − Y n , X 2 = Y 1 + Y 2 , X 3 = Y 1 + Y 3 , ... , X n = Y 1 + Y n .
and so the determinant is 1 and our joint pdf will be
1 ( 2 π ) n / 2 σ n exp ( − 1 2 σ 2 ( Y 1 − ∑ i = 2 n Y i − μ ) 2 ) exp ( − 1 2 σ 2 ∑ i = 2 n ( Y 1 + Y i − μ ) 2 ) \frac{1}{(2\pi)^{n/2}\sigma^n} \exp\left(-\frac{1}{2\sigma^2}(Y_1 - \sum_{i=2}^n Y_i - \mu)^2\right) \exp\left(-\frac{1}{2\sigma^2}\sum_{i=2}^{n}(Y_1 +Y_i - \mu)^2\right) ( 2 π ) n /2 σ n 1 exp ( − 2 σ 2 1 ( Y 1 − i = 2 ∑ n Y i − μ ) 2 ) exp ( − 2 σ 2 1 i = 2 ∑ n ( Y 1 + Y i − μ ) 2 )
( Y 1 − ∑ i = 2 n Y i − μ ) 2 + ∑ i = 2 n ( Y 1 + Y i − μ ) 2 (Y_1 - \sum_{i=2}^n Y_i - \mu)^2 +\sum_{i=2}^{n}(Y_1 +Y_i - \mu)^2 ( Y 1 − i = 2 ∑ n Y i − μ ) 2 + i = 2 ∑ n ( Y 1 + Y i − μ ) 2
= ( Y 1 − μ ) 2 − 2 ( Y 1 − μ ) ∑ i = 2 n Y i + ( ∑ i = 2 n Y i ) 2 = (Y_1 - \mu)^2 -2 (Y_1-\mu)\sum_{i=2}^n Y_i +\left(\sum_{i=2}^n Y_i\right)^2 = ( Y 1 − μ ) 2 − 2 ( Y 1 − μ ) i = 2 ∑ n Y i + ( i = 2 ∑ n Y i ) 2
+ ∑ i = 2 n ( Y 1 − μ ) 2 + 2 ( Y 1 − μ ) Y i + Y i 2 +\sum_{i=2}^n(Y_1-\mu)^2 +2(Y_1-\mu)Y_i+Y_i^2 + i = 2 ∑ n ( Y 1 − μ ) 2 + 2 ( Y 1 − μ ) Y i + Y i 2
= n ( Y 1 − μ ) 2 + ∑ i = 2 n Y i 2 + ( ∑ i = 2 n Y i ) 2 =n(Y_1 - \mu)^2+ \sum_{i=2}^n Y_i^2+\left(\sum_{i=2}^n Y_i\right)^2 = n ( Y 1 − μ ) 2 + i = 2 ∑ n Y i 2 + ( i = 2 ∑ n Y i ) 2
So the joint pdf can be split into
1 ( 2 π ) n / 2 σ n exp ( − n ( Y 1 − μ ) 2 2 σ 2 ) exp ( − ∑ i = 2 n Y i 2 + ( ∑ i = 2 n Y i ) 2 2 σ 2 ) \frac{1}{(2\pi)^{n/2}\sigma^n} \exp\left(-\frac{n(Y_1-\mu)^2}{2\sigma^2} \right)\exp\left(-\frac{\sum_{i=2}^n Y_i^2+\left(\sum_{i=2}^n Y_i\right)^2}{2\sigma^2} \right) ( 2 π ) n /2 σ n 1 exp ( − 2 σ 2 n ( Y 1 − μ ) 2 ) exp ( − 2 σ 2 ∑ i = 2 n Y i 2 + ( ∑ i = 2 n Y i ) 2 )
Therefore, Y 1 Y_1 Y 1 is independent of Y i Y_i Y i and so we have X ˉ \bar{X} X ˉ is independent of X i − X ˉ X_i-\bar{X} X i − X ˉ for any i i i .
Now, let us reiterate the theorem and prove:
Theorem. Let X 1 , … , X n ∼ N ( μ , σ 2 ) X_1, \ldots, X_n \sim N\left(\mu, \sigma^2\right) X 1 , … , X n ∼ N ( μ , σ 2 ) be a random sample, then X ˉ \bar{X} X ˉ and S 2 S^2 S 2 are independent, and
( n − 1 ) S 2 σ 2 ∼ χ n − 1 2 \frac{(n-1) S^2}{\sigma^2} \sim \chi_{n-1}^2 σ 2 ( n − 1 ) S 2 ∼ χ n − 1 2
Since S 2 = 1 n − 1 ∑ i ( X i − X ˉ ) 2 S^2 = \frac{1}{n-1}\sum_{i}(X_i -\bar{X})^2 S 2 = n − 1 1 ∑ i ( X i − X ˉ ) 2 and we know X i − X ˉ X_i -\bar{X} X i − X ˉ and X ˉ \bar{X} X ˉ are independent, so we will have X ˉ \bar{X} X ˉ and S 2 S^2 S 2 are independent.
Now let's consider
∑ i ( X i − μ ) 2 = ∑ i ( X i − X ˉ + X ˉ − μ ) 2 = ∑ i ( X i − X ˉ ) 2 + ( X ˉ − μ ) 2 + 2 ( X i − X ˉ ) ( X ˉ − μ ) = ∑ i ( X i − X ˉ ) 2 + n ( X ˉ − μ ) 2 \sum_i(X_i - \mu)^2 = \sum_i (X_i - \bar{X} +\bar{X} - \mu)^2 = \sum_i (X_i - \bar{X})^2 +(\bar{X} - \mu)^2 + 2(X_i -\bar{X})(\bar{X}-\mu) = \sum_i (X_i - \bar{X})^2 + n(\bar{X} - \mu)^2 i ∑ ( X i − μ ) 2 = i ∑ ( X i − X ˉ + X ˉ − μ ) 2 = i ∑ ( X i − X ˉ ) 2 + ( X ˉ − μ ) 2 + 2 ( X i − X ˉ ) ( X ˉ − μ ) = i ∑ ( X i − X ˉ ) 2 + n ( X ˉ − μ ) 2
and
∑ i ( X i − X ˉ ) 2 = ( n − 1 ) S 2 \sum_i (X_i - \bar{X})^2 = (n-1)S^2 i ∑ ( X i − X ˉ ) 2 = ( n − 1 ) S 2
so we will have
∑ i ( X i − μ ) 2 = ( n − 1 ) S 2 + n ( X ˉ − μ ) 2 \sum_i(X_i - \mu)^2 = (n-1)S^2+ n(\bar{X} - \mu)^2 i ∑ ( X i − μ ) 2 = ( n − 1 ) S 2 + n ( X ˉ − μ ) 2
If we divide both sides by σ 2 \sigma^2 σ 2 , we will have
∑ i ( X i − μ σ ) 2 = ( n − 1 ) S 2 σ 2 + ( X ˉ − μ σ / n ) 2 \sum_i\left(\frac{X_i - \mu}{\sigma}\right)^2 = \frac{(n-1)S^2}{\sigma^2} + \left(\frac{\bar{X}-\mu}{\sigma/\sqrt{n}}\right)^2 i ∑ ( σ X i − μ ) 2 = σ 2 ( n − 1 ) S 2 + ( σ / n X ˉ − μ ) 2
We know that ∑ i ( X i − μ σ ) 2 \sum_i\left(\frac{X_i - \mu}{\sigma}\right)^2 ∑ i ( σ X i − μ ) 2 forming a χ \chi χ -squared distribution with n n n degree of freedom and ( X ˉ − μ σ / n ) 2 \left(\frac{\bar{X}-\mu}{\sigma/\sqrt{n}}\right)^2 ( σ / n X ˉ − μ ) 2 forming a χ \chi χ -squared distribution with 1 1 1 degree of freedom so ( n − 1 ) S 2 σ 2 \frac{(n-1)S^2}{\sigma^2} σ 2 ( n − 1 ) S 2 forming a χ \chi χ -squared distribution with n − 1 n-1 n − 1 degree of freedom.
The upper α \alpha α -quantile of the chi-squared distribution with ν \nu ν degrees of freedom is defined as the following:
Pr [ X ≥ χ α , ν 2 ] = α \Pr[X\ge \chi_{\alpha, \nu}^2] = \alpha Pr [ X ≥ χ α , ν 2 ] = α
Example. Suppose a semiconductor company wants to test the thickness of their semiconductors. They tested a sample of size 20 (assuming the thicknesses are from a normal distribution N ( μ , σ 2 ) N\left(\mu, \sigma^2\right) N ( μ , σ 2 ) ). The production process is considered "out of control" if σ > 0.60 \sigma>0.60 σ > 0.60 with probability 0.01 . Suppose the test shows s = 0.84 s=0.84 s = 0.84 , is the process out of control?
19 × 0.84 2 0.6 2 = 37.24 \frac{19 \times 0.84^2}{ 0.6^2} = 37.24 0. 6 2 19 × 0.8 4 2 = 37.24
and Our critical χ 2 \chi^2 χ 2 -value χ 0.01 , 19 2 = 36.1909 \chi_{0.01, 19}^2 = 36.1909 χ 0.01 , 19 2 = 36.1909 . So the process is out of control.
The student t t t distribution
Suppose we have a random sample from a normal population N ( μ , σ 2 ) N\left(\mu, \sigma^2\right) N ( μ , σ 2 ) . Can we test the mean μ \mu μ without knowing σ 2 \sigma^2 σ 2 ?
Let Y ∼ χ ν 2 Y \sim \chi^2_{\nu} Y ∼ χ ν 2 and Z ∼ N ( 0 , 1 ) Z \sim N(0, 1) Z ∼ N ( 0 , 1 ) be independent, then
T = Z Y / ν T = \frac{ Z}{\sqrt{Y/\nu}} T = Y / ν Z has the probability density function given by
f r ( t ) = Γ ( ( ν + 1 ) / 2 ) π ν Γ ( ν / 2 ) ( 1 + t 2 / ν ) − ( ν + 1 ) / 2 , for t ∈ R . f_r(t) = \frac{\Gamma((\nu + 1)/2)}{\sqrt{\pi \nu} \Gamma(\nu/2)} (1 + t^2/\nu)^{-(\nu + 1)/2}, \quad \text{for } t \in \mathbb{R}. f r ( t ) = π ν Γ ( ν /2 ) Γ (( ν + 1 ) /2 ) ( 1 + t 2 / ν ) − ( ν + 1 ) /2 , for t ∈ R .
Here T T T is said to have the Student distribution with ν \nu ν degrees of freedom, i.e., T ∼ t ν T \sim t_\nu T ∼ t ν .
The joint pdf is the following:
1 2 π exp ( − z 2 2 ) 1 2 ν / 2 Γ ( ν / 2 ) y ν / 2 − 1 exp ( − y / 2 ) \frac{1}{\sqrt{2\pi}} \exp( -\frac{z^2}{2}) \frac{1}{2^{\nu/2}\Gamma(\nu/2)}y^{\nu/2-1}\exp(-y/2) 2 π 1 exp ( − 2 z 2 ) 2 ν /2 Γ ( ν /2 ) 1 y ν /2 − 1 exp ( − y /2 )
Now let's consider the following transformation:
( u , v ) = ( y , z y / ν ) (u, v) =(y, \frac{z}{\sqrt{y/\nu}}) ( u , v ) = ( y , y / ν z )
so ( y , z ) = ( u , v u / ν ) (y, z) = (u, v\sqrt{u/\nu}) ( y , z ) = ( u , v u / ν )
( 1 0 1 2 v ν − 1 / 2 u − 1 / 2 u / ν ) \begin{pmatrix}1 & 0 \\ \frac{1}{2}v\nu^{-1/2}u^{-1/2} & \sqrt{u/\nu}\end{pmatrix} ( 1 2 1 v ν − 1/2 u − 1/2 0 u / ν )
So the determinant is u / ν \sqrt{u/\nu} u / ν
and then the original one will become
1 2 π ν exp ( − u v 2 2 ν ) 1 2 ν / 2 Γ ( ν / 2 ) u ( ν − 1 ) / 2 exp ( − u / 2 ) = 1 2 π ν 2 ν 2 Γ ( ν / 2 ) u ν − 1 2 exp ( − u 2 ( 1 + v 2 ν ) ) \frac{1}{\sqrt{2\pi\nu}} \exp\left( -\frac{uv^2 }{2\nu}\right) \frac{1}{2^{\nu/2}\Gamma(\nu/2)}u^{(\nu-1)/2}\exp(-u/2)= \frac{1}{\sqrt{2\pi\nu}2^{\frac{\nu}{2}}\Gamma(\nu/2)}u^{\frac{\nu-1}{2}}\exp\left(-\frac{u}{2}(1+\frac{v^2}{\nu})\right) 2 π ν 1 exp ( − 2 ν u v 2 ) 2 ν /2 Γ ( ν /2 ) 1 u ( ν − 1 ) /2 exp ( − u /2 ) = 2 π ν 2 2 ν Γ ( ν /2 ) 1 u 2 ν − 1 exp ( − 2 u ( 1 + ν v 2 ) )
Now let's compute the following marginal pdf:
∫ 0 ∞ 1 2 π ν 2 ν 2 Γ ( ν / 2 ) u ν − 1 2 exp ( − u 2 ( 1 + v 2 ν ) ) d u = 1 2 π ν 2 ν 2 Γ ( ν / 2 ) ∫ 0 ∞ u ν − 1 2 exp ( − u 2 ( 1 + v 2 ν ) ) d u \int_0^{\infty}\frac{1}{\sqrt{2\pi\nu}2^{\frac{\nu}{2}}\Gamma(\nu/2)}u^{\frac{\nu-1}{2}}\exp\left(-\frac{u}{2}(1+\frac{v^2}{\nu})\right) \, du \\= \frac{1}{\sqrt{2\pi\nu}2^{\frac{\nu}{2}}\Gamma(\nu/2)}\int_0^{\infty}u^{\frac{\nu-1}{2}}\exp\left(-\frac{u}{2}(1+\frac{v^2}{\nu})\right) \, du ∫ 0 ∞ 2 π ν 2 2 ν Γ ( ν /2 ) 1 u 2 ν − 1 exp ( − 2 u ( 1 + ν v 2 ) ) d u = 2 π ν 2 2 ν Γ ( ν /2 ) 1 ∫ 0 ∞ u 2 ν − 1 exp ( − 2 u ( 1 + ν v 2 ) ) d u
Let t = u 2 ( 1 + v 2 ν ) t = \frac{u}{2}(1+\frac{v^2}{\nu}) t = 2 u ( 1 + ν v 2 ) ,
u = 2 t 1 + v 2 ν , d u = 2 d t 1 + v 2 ν u = \frac{2t}{1+\frac{v^2}{\nu}}, du = \frac{2dt}{1+\frac{v^2}{\nu}} u = 1 + ν v 2 2 t , d u = 1 + ν v 2 2 d t
The marginal pdf will become
2 1 2 2 π ν Γ ( ν / 2 ) ( 1 1 + v 2 ν ) ν + 1 2 ∫ 0 ∞ t ν − 1 2 exp ( − t ) d t = Γ ( ν + 1 2 ) π ν Γ ( ν / 2 ) ( 1 1 + v 2 ν ) ν + 1 2 \frac{2^{\frac{1}{2}}}{\sqrt{2\pi\nu}\Gamma(\nu/2)} \left(\frac{1}{1+\frac{v^2}{\nu}}\right)^{\frac{\nu+1}{2}}\int_0^{\infty} t^{\frac{\nu-1}{2}}\exp(-t)\, dt = \frac{\Gamma(\frac{\nu+1}{2})}{\sqrt{\pi\nu}\Gamma(\nu/2)} \left(\frac{1}{1+\frac{v^2}{\nu}}\right)^{\frac{\nu+1}{2}} 2 π ν Γ ( ν /2 ) 2 2 1 ( 1 + ν v 2 1 ) 2 ν + 1 ∫ 0 ∞ t 2 ν − 1 exp ( − t ) d t = π ν Γ ( ν /2 ) Γ ( 2 ν + 1 ) ( 1 + ν v 2 1 ) 2 ν + 1
, which proves our theorem.
Theorem. Suppose X ˉ \bar{X} X ˉ and S 2 S^2 S 2 are respectively the sample mean and sample variance of a random sample from N ( μ , σ 2 ) N\left(\mu, \sigma^2\right) N ( μ , σ 2 ) , then
v = X ˉ − μ S / n ∼ t n − 1 v=\frac{\bar{X}-\mu}{S / \sqrt{n}} \sim t_{n-1} v = S / n X ˉ − μ ∼ t n − 1
Proof.
We know that u = ( n − 1 ) S 2 σ 2 ∼ χ n − 1 2 u=\frac{(n-1)S^2}{\sigma^2} \sim \chi^2_{n-1} u = σ 2 ( n − 1 ) S 2 ∼ χ n − 1 2 and X ˉ − μ σ / n ∼ N ( 0 , 1 ) \frac{\bar{X}-\mu}{\sigma/\sqrt{n}} \sim N(0,1) σ / n X ˉ − μ ∼ N ( 0 , 1 ) and so
S 2 = σ 2 u n − 1 , S = σ u n − 1 S^2 = \frac{\sigma^2 u}{n-1}, S = \sigma\sqrt{\frac{u}{n-1}} S 2 = n − 1 σ 2 u , S = σ n − 1 u
X ˉ − μ S / n = X ˉ − μ σ u n − 1 / n = v u n − 1 \frac{\bar{X}-\mu}{S / \sqrt{n}}= \frac{\bar{X}-\mu}{\sigma\sqrt{\frac{u}{n-1}} / \sqrt{n}} = \frac{v}{\sqrt{\frac{u}{n-1}}} S / n X ˉ − μ = σ n − 1 u / n X ˉ − μ = n − 1 u v
So it's the t t t distribution with ν = n − 1. \nu = n-1. ν = n − 1.
Example. Suppose we obtain a random sample of size 16 from a normal population. Using this sample, we figure that x ˉ = 16.1 \bar{x}=16.1 x ˉ = 16.1 and s = 2.1 s=2.1 s = 2.1 . Can we declare that the true mean μ > 12.0 \mu>12.0 μ > 12.0 with confidence 0.99 ?
16.1 − 12.0 2.1 / 16 = 7.809 \frac{16.1-12.0}{2.1/\sqrt{16}} = 7.809 2.1/ 16 16.1 − 12.0 = 7.809
The t critical value is t 0.005 , 15 = 2.946712 t_{0.005, 15} = 2.946712 t 0.005 , 15 = 2.946712 . So we have the confidence.
Fisher F distribution
Theorem. Suppose U ∼ χ ν 1 2 U \sim \chi_{\nu_1}^2 U ∼ χ ν 1 2 and V ∼ χ ν 2 2 V \sim \chi_{\nu_2}^2 V ∼ χ ν 2 2 are independent, then
F = U / ν 1 V / ν 2 F=\frac{U / \nu_1}{V / \nu_2} F = V / ν 2 U / ν 1
has the pdf given by
g ( f ) = { Γ ( ν 1 + ν 2 2 ) Γ ( ν 1 2 ) Γ ( ν 2 2 ) ( ν 1 ν 2 ) ν 1 2 ⋅ f ν 1 2 − 1 ( 1 + ν 1 ν 2 f ) − 1 2 ( ν 1 + ν 2 ) , if f > 0 0 , elsewhere. g(f)= \begin{cases}\frac{\Gamma\left(\frac{\nu_1+\nu_2}{2}\right)}{\Gamma\left(\frac{\nu_1}{2}\right) \Gamma\left(\frac{\nu_2}{2}\right)}\left(\frac{\nu_1}{\nu_2}\right)^{\frac{\nu_1}{2}} \cdot f^{\frac{\nu_1}{2}-1}\left(1+\frac{\nu_1}{\nu_2} f\right)^{-\frac{1}{2}\left(\nu_1+\nu_2\right)}, & \text { if } f>0 \\ 0, & \text { elsewhere. }\end{cases} g ( f ) = ⎩ ⎨ ⎧ Γ ( 2 ν 1 ) Γ ( 2 ν 2 ) Γ ( 2 ν 1 + ν 2 ) ( ν 2 ν 1 ) 2 ν 1 ⋅ f 2 ν 1 − 1 ( 1 + ν 2 ν 1 f ) − 2 1 ( ν 1 + ν 2 ) , 0 , if f > 0 elsewhere.
Here F F F is said to have the F F F -distribution with degrees of freedoms ν 1 \nu_1 ν 1 and ν 2 \nu_2 ν 2 , denoted by F ∼ F ν 1 , ν 2 F \sim F_{\nu_1, \nu_2} F ∼ F ν 1 , ν 2 .
Let's consider the joint pdf:
1 2 ν 1 / 2 Γ ( ν 1 / 2 ) u ( ν 1 − 2 ) / 2 e − u / 2 1 2 ν 2 / 2 Γ ( ν 2 / 2 ) v ( ν 2 − 2 ) / 2 e − v / 2 \frac{1}{2^{\nu_1 / 2} \Gamma(\nu_1 / 2)} u^{(\nu_1-2) / 2} e^{-u / 2} \frac{1}{2^{\nu_2 / 2} \Gamma(\nu_2 / 2)} v^{(\nu_2-2) / 2} e^{-v / 2} 2 ν 1 /2 Γ ( ν 1 /2 ) 1 u ( ν 1 − 2 ) /2 e − u /2 2 ν 2 /2 Γ ( ν 2 /2 ) 1 v ( ν 2 − 2 ) /2 e − v /2
1 2 ( ν 1 + ν 2 ) / 2 Γ ( ν 1 / 2 ) Γ ( ν 2 / 2 ) u ( ν 1 − 2 ) / 2 v ( ν 2 − 2 ) / 2 exp ( − ( u + v ) / 2 ) \frac{1}{2^{(\nu_1+\nu_2)/2}\Gamma(\nu_1/2)\Gamma(\nu_2/2)} u^{(\nu_1-2)/2}v^{(\nu_2-2)/2}\exp(-(u+v)/2) 2 ( ν 1 + ν 2 ) /2 Γ ( ν 1 /2 ) Γ ( ν 2 /2 ) 1 u ( ν 1 − 2 ) /2 v ( ν 2 − 2 ) /2 exp ( − ( u + v ) /2 )
Describe the following transformation ( a , b ) = ( u / ν 1 , v / ν 2 ) (a,b) = (u/\nu_1, v/\nu_2) ( a , b ) = ( u / ν 1 , v / ν 2 ) , then we will have ( u , v ) = ( a ν 1 , b ν 2 ) (u,v) = (a\nu_1, b\nu_2) ( u , v ) = ( a ν 1 , b ν 2 ) and so
( ν 1 0 0 ν 2 ) \begin{pmatrix}\nu_1 & 0 \\ 0 & \nu_2\end{pmatrix} ( ν 1 0 0 ν 2 )
and the determinant will be ν 1 ν 2 \nu_1 \nu_2 ν 1 ν 2 .
The joint distribution will become
1 2 ( ν 1 + ν 2 ) / 2 Γ ( ν 1 / 2 ) Γ ( ν 2 / 2 ) ( a ν 1 ) ( ν 1 − 2 ) / 2 ( b ν 2 ) ( ν 2 − 2 ) / 2 exp ( − ( a ν 1 + b ν 2 ) / 2 ) ν 1 ν 2 \frac{1}{2^{(\nu_1+\nu_2)/2}\Gamma(\nu_1/2)\Gamma(\nu_2/2)} (a\nu_1)^{(\nu_1-2)/2}(b\nu_2)^{(\nu_2-2)/2}\exp(-(a\nu_1+b\nu_2)/2)\nu_1\nu_2 2 ( ν 1 + ν 2 ) /2 Γ ( ν 1 /2 ) Γ ( ν 2 /2 ) 1 ( a ν 1 ) ( ν 1 − 2 ) /2 ( b ν 2 ) ( ν 2 − 2 ) /2 exp ( − ( a ν 1 + b ν 2 ) /2 ) ν 1 ν 2
= ν 1 ( ν 1 − 2 ) / 2 ν 2 ( ν 2 − 2 ) / 2 2 ( ν 1 + ν 2 ) / 2 Γ ( ν 1 / 2 ) Γ ( ν 2 / 2 ) a ( ν 1 − 2 ) / 2 b ( ν 2 − 2 ) / 2 exp ( − ( a ν 1 + b ν 2 ) / 2 ) ν 1 ν 2 = \frac{\nu_1^{(\nu_1-2)/2} \nu_2^{(\nu_2-2)/2}}{2^{(\nu_1+\nu_2)/2}\Gamma(\nu_1/2)\Gamma(\nu_2/2)} a^{(\nu_1-2)/2}b^{(\nu_2-2)/2}\exp(-(a\nu_1+b\nu_2)/2)\nu_1\nu_2 = 2 ( ν 1 + ν 2 ) /2 Γ ( ν 1 /2 ) Γ ( ν 2 /2 ) ν 1 ( ν 1 − 2 ) /2 ν 2 ( ν 2 − 2 ) /2 a ( ν 1 − 2 ) /2 b ( ν 2 − 2 ) /2 exp ( − ( a ν 1 + b ν 2 ) /2 ) ν 1 ν 2
Let ( x , y ) = ( b , a / b ) (x,y)=(b, a/b) ( x , y ) = ( b , a / b ) then we will have ( a , b ) = ( x y , x ) (a,b) = (xy, x) ( a , b ) = ( x y , x )
( y x 1 0 ) \begin{pmatrix} y & x \\ 1 & 0\end{pmatrix} ( y 1 x 0 )
And so we will have
= ν 1 ( ν 1 − 2 ) / 2 ν 2 ( ν 2 − 2 ) / 2 2 ( ν 1 + ν 2 ) / 2 Γ ( ν 1 / 2 ) Γ ( ν 2 / 2 ) ( x y ) ( ν 1 − 2 ) / 2 x ( ν 2 − 2 ) / 2 exp ( − ( x y ν 1 + x ν 2 ) / 2 ) x ν 1 ν 2 = \frac{\nu_1^{(\nu_1-2)/2} \nu_2^{(\nu_2-2)/2}}{2^{(\nu_1+\nu_2)/2}\Gamma(\nu_1/2)\Gamma(\nu_2/2)} (xy)^{(\nu_1-2)/2}x^{(\nu_2-2)/2}\exp(-(xy\nu_1+x\nu_2)/2)x\nu_1\nu_2 = 2 ( ν 1 + ν 2 ) /2 Γ ( ν 1 /2 ) Γ ( ν 2 /2 ) ν 1 ( ν 1 − 2 ) /2 ν 2 ( ν 2 − 2 ) /2 ( x y ) ( ν 1 − 2 ) /2 x ( ν 2 − 2 ) /2 exp ( − ( x y ν 1 + x ν 2 ) /2 ) x ν 1 ν 2
ν 1 ν 1 / 2 ν 2 ν 2 / 2 y ( ν 1 − 2 ) / 2 2 ( ν 1 + ν 2 ) / 2 Γ ( ν 1 / 2 ) Γ ( ν 2 / 2 ) x ( ν 1 + ν 2 − 2 ) / 2 exp ( − x 2 ν 2 + y ν 1 ) \frac{\nu_1^{\nu_1/2} \nu_2^{\nu_2/2}y^{(\nu_1-2)/2}}{2^{(\nu_1+\nu_2)/2}\Gamma(\nu_1/2)\Gamma(\nu_2/2)} x^{(\nu_1+\nu_2-2)/2}\exp\left(-\frac{x}{\frac{2}{\nu_2+y\nu_1}}\right) 2 ( ν 1 + ν 2 ) /2 Γ ( ν 1 /2 ) Γ ( ν 2 /2 ) ν 1 ν 1 /2 ν 2 ν 2 /2 y ( ν 1 − 2 ) /2 x ( ν 1 + ν 2 − 2 ) /2 exp ( − ν 2 + y ν 1 2 x )
Let t = x 2 ν 2 + y ν 1 t= \frac{x}{\frac{2}{\nu_2+y\nu_1}} t = ν 2 + y ν 1 2 x , then x = 2 t ν 2 + y ν 1 x = \frac{2t}{\nu_2+y\nu_1} x = ν 2 + y ν 1 2 t , d x = 2 d t ν 2 + y ν 1 dx = \frac{2dt}{\nu_2+y\nu_1} d x = ν 2 + y ν 1 2 d t
The original joint distribution will be
∫ 0 ∞ ν 1 ν 1 / 2 ν 2 ν 2 / 2 y ( ν 1 − 2 ) / 2 2 ( ν 1 + ν 2 ) / 2 Γ ( ν 1 / 2 ) Γ ( ν 2 / 2 ) t ( ν 1 + ν 2 − 2 ) / 2 exp ( − t ) ( 2 ν 2 + y ν 1 ) ( ν 1 + ν 2 ) / 2 \int_0^{\infty}\frac{\nu_1^{\nu_1/2} \nu_2^{\nu_2/2}y^{(\nu_1-2)/2}}{2^{(\nu_1+\nu_2)/2}\Gamma(\nu_1/2)\Gamma(\nu_2/2)} t^{(\nu_1+\nu_2-2)/2}\exp\left(-t\right) \left(\frac{2}{\nu_2 +y \nu_1}\right)^{(\nu_1+\nu_2)/2} ∫ 0 ∞ 2 ( ν 1 + ν 2 ) /2 Γ ( ν 1 /2 ) Γ ( ν 2 /2 ) ν 1 ν 1 /2 ν 2 ν 2 /2 y ( ν 1 − 2 ) /2 t ( ν 1 + ν 2 − 2 ) /2 exp ( − t ) ( ν 2 + y ν 1 2 ) ( ν 1 + ν 2 ) /2
= Γ ( ν 1 + ν 2 2 ) Γ ( ν 1 / 2 ) Γ ( ν 2 / 2 ) ( ν 1 ν 2 ) ν 1 / 2 y ν 1 / 2 − 1 ( 1 + ν 1 ν 2 y ) − ( ν 1 + ν 2 ) / 2 = \frac{\Gamma(\frac{\nu_1 + \nu_2}{2})}{\Gamma(\nu_1/2)\Gamma(\nu_2/2)} \left(\frac{\nu_1}{\nu_2}\right)^{\nu_1/2} y^{\nu_1/2-1}\left({1 + \frac{\nu_1}{\nu_2}y }\right)^{-(\nu_1+\nu_2)/2} = Γ ( ν 1 /2 ) Γ ( ν 2 /2 ) Γ ( 2 ν 1 + ν 2 ) ( ν 2 ν 1 ) ν 1 /2 y ν 1 /2 − 1 ( 1 + ν 2 ν 1 y ) − ( ν 1 + ν 2 ) /2
We can say that it's Fisher distribution with degree of freedom ν 1 \nu_1 ν 1 and ν 2 \nu_2 ν 2 .
Application of F F F statistics: compare the ratio of σ 1 2 \sigma_1^2 σ 1 2 and σ 2 2 \sigma_2^2 σ 2 2 from two independent normal populations.
Theorem. Suppose there are two independent normal populations with variances σ 1 2 \sigma_1^2 σ 1 2 and σ 2 2 \sigma_2^2 σ 2 2 , and S 1 2 S_1^2 S 1 2 and S 2 2 S_2^2 S 2 2 are the sample variances of two random samples of size n 1 n_1 n 1 and n 2 n_2 n 2 from these two populations. Then
F = S 1 2 / σ 1 2 S 2 2 / σ 2 2 = σ 2 2 S 1 2 σ 1 2 S 2 2 ∼ F n 1 − 1 , n 2 − 1 F=\frac{S_1^2 / \sigma_1^2}{S_2^2 / \sigma_2^2}=\frac{\sigma_2^2 S_1^2}{\sigma_1^2 S_2^2} \sim F_{n_1-1, n_2-1} F = S 2 2 / σ 2 2 S 1 2 / σ 1 2 = σ 1 2 S 2 2 σ 2 2 S 1 2 ∼ F n 1 − 1 , n 2 − 1
Proof.
u i = ( n i − 1 ) S i 2 σ i 2 ∼ χ n i − 1 2 u_i=\frac{(n_i-1)S_i^2}{\sigma_i^2} \sim \chi_{n_i-1}^2 u i = σ i 2 ( n i − 1 ) S i 2 ∼ χ n i − 1 2
and so
F = u 1 / ( n 1 − 1 ) u 2 / ( n 2 − 1 ) ∼ F n 1 − 1 , n 2 − 1 . F = \frac{u_1/(n_1-1)}{u_2/(n_2-1)} \sim F_{n_1-1,n_2-1}. F = u 2 / ( n 2 − 1 ) u 1 / ( n 1 − 1 ) ∼ F n 1 − 1 , n 2 − 1 .
Order statistics.
The order statistics concerns essentially the k k k -th ordered item will be with certain probability. A formal definition is the following. Suppose we have X 1 , X 2 , . . . , X n X_1, X_2, ... , X_n X 1 , X 2 , ... , X n are drawn from a distribution, if we order them, then we will have Y 1 , Y 2 , . . . Y n Y_1, Y_2, ... Y_n Y 1 , Y 2 , ... Y n where Y i Y_i Y i represents i i i -th smallest element.
Theorem. The pdf g r g_r g r of Y r Y_r Y r is given by
g r ( y r ) = n ! ( r − 1 ) ! ( n − r ) ! [ ∫ − ∞ y r f ( x ) d x ] r − 1 f ( y r ) [ ∫ y r ∞ f ( x ) d x ] n − r g_r\left(y_r\right)=\frac{n !}{(r-1) !(n-r) !}\left[\int_{-\infty}^{y_r} f(x) d x\right]^{r-1} f\left(y_r\right)\left[\int_{y_r}^{\infty} f(x) d x\right]^{n-r} g r ( y r ) = ( r − 1 )! ( n − r )! n ! [ ∫ − ∞ y r f ( x ) d x ] r − 1 f ( y r ) [ ∫ y r ∞ f ( x ) d x ] n − r
for − ∞ < y r < ∞ -\infty<y_r<\infty − ∞ < y r < ∞ .
Proof: See "Introduction to Beta Distribution" in this blog.
From the above, we will have:
• Minimal statistic Y 1 Y_1 Y 1 has pdf
f Y 1 ( y ) = n f ( y ) [ ∫ y ∞ f ( x ) d x ] n − 1 f_{Y_1}(y) = n f(y) \left[\int_{y}^{\infty} f(x) d x\right]^{n-1} f Y 1 ( y ) = n f ( y ) [ ∫ y ∞ f ( x ) d x ] n − 1
and
• Maximal statistic Y n Y_n Y n has pdf
f Y n ( y ) = n f ( y ) [ ∫ − ∞ y f ( x ) d x ] n − 1 f_{Y_n}(y) = n f(y) \left[\int_{-\infty}^{y} f(x) d x\right]^{n-1} f Y n ( y ) = n f ( y ) [ ∫ − ∞ y f ( x ) d x ] n − 1
• If n = 2 m + 1 n = 2m + 1 n = 2 m + 1 is odd, then the sample median Y m + 1 Y_{m+1} Y m + 1 has pdf
f Y m + 1 ( y ) = n ! m ! m ! f ( y ) [ ∫ y ∞ f ( x ) d x ] m [ ∫ − ∞ y f ( x ) d x ] m f_{Y_{m+1}}(y) = \frac{n!}{m! m!}f(y) \left[\int_{y}^{\infty} f(x) d x\right]^{m}\left[\int_{-\infty}^{y} f(x) d x\right]^{m} f Y m + 1 ( y ) = m ! m ! n ! f ( y ) [ ∫ y ∞ f ( x ) d x ] m [ ∫ − ∞ y f ( x ) d x ] m
Example. Suppose X 1 , … , X n X_1, \ldots, X_n X 1 , … , X n is a random sample from Exp ( θ ) \operatorname{Exp}(\theta) Exp ( θ ) , i.e., the pdf is f Y ( x ) = 1 θ e − x / θ f_Y(x)=\frac{1}{\theta} e^{-x / \theta} f Y ( x ) = θ 1 e − x / θ , then the pdf of Y 1 Y_1 Y 1 is
F Y ( x ) = ∫ 0 x 1 θ exp ( − y / θ ) d y = 1 − exp ( − x / θ ) F_{Y}(x)=\int_0^{x} \frac{1}{\theta}\exp(-y/\theta)\, dy = 1-\exp(-x/\theta) F Y ( x ) = ∫ 0 x θ 1 exp ( − y / θ ) d y = 1 − exp ( − x / θ )
So
f Y 1 ( y ) = n θ [ exp ( − n y / θ ) ] f_{Y_1} (y) = \frac{n}{\theta} \left[\exp(-ny/\theta)\right] f Y 1 ( y ) = θ n [ exp ( − n y / θ ) ]
f Y n ( y ) = n θ exp ( − y / θ ) [ 1 − exp ( − y / θ ) ] n − 1 f_{Y_n}(y) = \frac{n}{\theta} \exp(-y/\theta) [1-\exp(-y/\theta)]^{n-1} f Y n ( y ) = θ n exp ( − y / θ ) [ 1 − exp ( − y / θ ) ] n − 1
f Y m + 1 ( y ) = ( 2 m + 1 ) ! m ! m ! n θ exp ( − y ( m + 1 ) / θ ) [ 1 − exp ( − y / θ ) ] m f_{Y_{m+1}}(y) = \frac{(2m+1)!}{m!m!}\frac{n}{\theta} \exp(-y(m+1)/\theta)[1-\exp(-y/\theta)]^{m} f Y m + 1 ( y ) = m ! m ! ( 2 m + 1 )! θ n exp ( − y ( m + 1 ) / θ ) [ 1 − exp ( − y / θ ) ] m