Derivation of probability density function of t distribution

The derivation process is compiled from https://www.bilibili.com/video/BV1s54y1S7Ji .

Preliminary knowledge

Γ \GammaΓ function (gamma function)

  • 定义: Γ ( s ) = ∫ 0 + ∞ e − t t s − 1 d t \Gamma(s)=\int_{0}^{+\infty}e^{-t}t^{s-1}\text{d}t C ( s )=0+etts1dt
  • Supplementary formula: Γ ( s + 1 ) = s Γ ( s ) , ( s > 0 ) \Gamma(s+1)=s\Gamma(s),\space(s>0)C ( s+1)=sΓ(s), (s>0)
  • Several important values: Γ ( 1 ) = 1 \Gamma(1)=1C ( 1 )=1Γ ( 1 2 ) = π \Gamma(\frac{1}{2})=\sqrt{\pi}C (21)=Pi

standard normal distribution

  • Probability density function: φ ( x ) = 1 2 π e − x 2 2 \varphi(x)=\frac{1}{\sqrt{2\pi}}e^{-\frac{x^2}{2 }}φ ( x )=2 p.m 1e2x2
  • Distribution function: ϕ ( x ) = ∫ − ∞ x 1 2 π e − t 2 2 dt \phi(x)=\int_{-\infty}^{x}\frac{1}{\sqrt{2\pi }}e^{-\frac{t^2}{2}}\text{d}tϕ ( x )=x2 p.m 1e2t2dt

chi-square distribution

  • Probability density function: p ( x ) = { 1 2 n / 2 Γ ( n / 2 ) e − x 2 xn 2 − 1 , x > 0 0 , x ⩽ 0 p(x)=\left\{\begin{ array}{cc} \frac{1}{2^{n/2}\Gamma(n/2)}e^{-\frac{x}{2}}x^{\frac{n}{2} -1}, & x>0 \\ 0, & x\leqslant 0 \end{array}\right.p(x)={ 2n/2Γ(n/2)1e2xx2n1,0,x>0x0

derivation target

Known XXX obeys standard normal distributionN ( 0 , 1 ) N(0,1)N(0,1 )YYY obeys chi-square distributionχ 2 ( n ) \chi^2(n)h2 (n), andXXXYYY are independent of each other.

T = XY / n T=\frac{X}{\sqrt{Y/n}}T=and / n XThe probability density function of .

Lemma: Distribution of Quotients of Continuous Random Variables

( X , Y ) (X,Y)(X,Y ) is a two-dimensional random variable, and its joint density function isp ( x , y ) p(x,y)p(x,y ),则Z = X / YZ=X/YZ=Density functionp Z ( z ) p_{Z}(z) of X / YpZ( z ) satisfyp
Z ( z ) = ∫ − ∞ + ∞ p ( zy , y ) ∣ y ∣ dy 。 p_{Z}(z) = \int_{-\infty}^{+\infty}p(zy , y)|y|\text{d}y \thinspace。pZ(z)=+p(zy,y)ydy.
prove

Using the distribution function method, first find ZZThe distribution function of Z , and then derive the distribution function to getp Z ( z ) p_{Z}(z)pZ(z)

againstzz _The positive and negative nature of z is discussed, and the integral area is obtained as shown in the shaded part in the figure below.

We found that these two cases can be combined, and the integration area is { ( y , x ) ∣ y < 0 ∧ x ⩾ zy } \{(y,x) \space|\space y<0 \space\wedge\space x \geqslant zy\}{ (y,x)  y<0  xzy}   ∪   \space\cup\space    { ( y , x )   ∣   y > 0   ∧   x ⩽ z y } \{(y,x) \space|\space y>0 \space\wedge\space x\leqslant zy\} { (y,x)y  >0  xz y } . So there is
F Z ( z )    =    P ( Z < z )    =    P ( X Y < z )    =    ∫ − ∞ 0 d y ∫ y z + ∞ p ( x , y ) d x + ∫ 0 + ∞ d y ∫ − ∞ y z p ( x , y ) d x = x = u y ∫ − ∞ 0 d y ∫ z + ∞ p ( u y , y ) y d u + ∫ 0 + ∞ d y ∫ − ∞ z p ( u y , y ) y d u    =    ∫ z + ∞ d u ∫ − ∞ 0 p ( u y , y ) y d y + ∫ − ∞ z d u ∫ 0 + ∞ p ( u y , y ) y d y   。 \begin{aligned} F_{Z}(z) &\space\space=\space\space P(Z<z) \\ &\space\space=\space\space P(\frac{X}{Y}<z) \\ &\space\space=\space\space \int_{-\infty}^{0}\text{d}y\int_{yz}^{+\infty}p(x,y)\text{d}x + \int_{0}^{+\infty}\text{d}y\int_{-\infty}^{yz}p(x,y)\text{d}x \\ &\overset{x=uy}{=} \int_{-\infty}^{0}\text{d}y\int_{z}^{+\infty}p(uy,y)y\text{d}u + \int_{0}^{+\infty}\text{d}y\int_{-\infty}^{z}p(uy,y)y\text{d}u \\ &\space\space=\space\space \int_{z}^{+\infty}\text{d}u\int_{-\infty}^{0}p(uy,y)y\text{d}y + \int_{-\infty}^{z}\text{d}u\int_{0}^{+\infty}p(uy,y)y\text{d}y \thinspace。 \end{aligned} FZ(z)  =  P(Z<z)  =  P(YX<z)  =  0dyyz+p(x,y)dx+0+dyyzp(x,y)dx=x = u y0dyz+p ( u y ,the ) the d u+0+dyzp ( u y ,the ) the d u  =  z+of u0p ( u y ,the ) the d the+zof u0+p ( u y ,the ) the d the因此
p Z ( z ) = F Z ′ ( z ) = − ∫ − ∞ 0 p ( z y , y ) y d y + ∫ 0 + ∞ p ( z y , y ) y d y = ∫ − ∞ + ∞ p ( z y , y ) ∣ y ∣ d y   。 \begin{aligned} p_{Z}(z) &= F_{Z}'(z) \\ &= -\int_{-\infty}^{0}p(zy,y)y\text{d}y + \int_{0}^{+\infty}p(zy,y)y\text{d}y \\ &= \int_{-\infty}^{+\infty}p(zy,y)|y|\text{d}y \thinspace。 \end{aligned} pZ(z)=FZ(z)=0p(zy,the ) the d the+0+p(zy,the ) the d the=+p(zy,y)ydy

The derivation process

First calculate W = Y / n W=\sqrt{Y/n}W=and / n The probability density function p W ( w ) p_{W}(w)pW(w)

Again, we use the distribution function approach. When w ⩽ 0 w\leqslant 0w0 , notice thatW = Y / n W=\sqrt{Y/n}W=and / n Constantly non-negative, so P ( W < w ) = 0 P(W<w)=0P(W<w)=0 , sop W ( w ) = 0 p_{W}(w)=0pW(w)=0 . Below forw > 0 w>0w>0 is calculated.
FW ( w ) = P ( W < w ) = P ( Y < nw 2 ) = ∫ 0 nw 2 1 2 n / 2 Γ ( n / 2 ) e − x 2 xn 2 − 1 dx . \begin{aligned} F_{W}(w) &= P(W<w) \\ &= P(Y<nw^2) \\ &= \int_{0}^{nw^2}\frac{ 1}{2^{n/2}\Gamma(n/2)}e^{-\frac{x}{2}}x^{\frac{n}{2}-1}\text{d} x \thinspace. \end{aligned}FW(w)=P(W<w)=P ( Y)<nw2)=0nw22n/2Γ(n/2)1e2xx2n1dxForm
p W ( w ) = FW ′ ( w ) = 1 2 n / 2 Γ ( n / 2 ) e − nw 2 2 ( nw 2 ) n 2 − 1 ⋅ 2 nw = 1 Γ ( n / 2 ) . 2 1 − n 2 nn 2 e − nw 2 2 wn − 1 \begin{aligned} p_{W}(w) &= F_{W}'(w) \\ &= \frac{1}{2^ {n/2}\Gamma(n/2)}e^{-\frac{nw^2}{2}}(nw^2)^{\frac{n}{2}-1}\cdot 2nw \ \ &= \frac{1}{\Gamma(n/2)}2^{1-\frac{n}{2}}n^{\frac{n}{2}} e^{-\frac{ nw^2}{2}}w^{n-1} \thinspace。\end{aligned}pW(w)=FW(w)=2n/2Γ(n/2)1e2nw2(nw2)2n12nw=C ( n / 2 )1212nn2ne2nw2wn1综上,有
p W ( w ) = { 1 Γ ( n / 2 ) 2 1 − n 2 n n 2 e − n w 2 2 w n − 1 , w > 0 0 , w ⩽ 0   。 p_{W}(w) = \left\{\begin{array}{cc} \frac{1}{\Gamma(n/2)}2^{1-\frac{n}{2}}n^{\frac{n}{2}} e^{-\frac{nw^2}{2}}w^{n-1}, & w>0 \\ 0, & w\leqslant 0 \end{array}\right. \thinspace。 pW(w)={ C ( n / 2 )1212nn2ne2nw2wn1,0,w>0w0

Then calculate T = XWT=\frac{X}{W}T=WXProbability density function p T ( t ) p_{T}(t)pT(t)

because XXXYYY are independent of each other, soXXX givenW = Y / n W=\sqrt{Y/n}W=and / n are also independent of each other, so ( X , W ) (X,W)(X,W ) joint probability density functionp ( x , w ) p(x,w)p(x,w)满足
p ( x , w ) = p X ( x ) p W ( w )   。 p(x,w) = p_{X}(x)p_{W}(w) \thinspace。 p(x,w)=pX(x)pW(w). Then by the lemma, we have
p T ( t )     =     ∫ − ∞ + ∞ p ( t w , w ) ∣ w ∣ d w     =     ∫ − ∞ + ∞ p X ( t w ) p W ( w ) ∣ w ∣ d w     =     ∫ 0 + ∞ p X ( t w ) p W ( w ) w d w     =     ∫ 0 + ∞ 1 2 π e − t 2 w 2 2 ⋅ 1 Γ ( n 2 ) 2 1 − n 2 n n 2 e − n w 2 2 w n − 1 ⋅ w d w     =     1 π ⋅ Γ ( n 2 ) 2 1 − n 2 n n 2 ∫ 0 + ∞ e − n + t 2 2 w 2 w n d w = w = 2 z n + t 2 1 π ⋅ Γ ( n 2 ) 2 1 − n 2 n n 2 ⋅ 1 2 ( 2 n + t 2 ) n + 1 2 ∫ 0 + ∞ e − z z n − 1 2 d z     =     Γ ( n + 1 2 ) π ⋅ Γ ( n 2 ) ⋅ n n 2 ( 1 n + t 2 ) n + 1 2     =     Γ ( n + 1 2 ) n π ⋅ Γ ( n 2 ) ( 1 + t 2 n ) − n + 1 2   。 \begin{aligned} p_{T}(t) &\quad\space\,=\quad\space\, \int_{-\infty}^{+\infty}p(tw, w)|w|\text{d}w \\ &\quad\space\,=\quad\space\, \int_{-\infty}^{+\infty}p_{X}(tw)p_{W}(w)|w|\text{d}w \\ &\quad\space\,=\quad\space\, \int_{0}^{+\infty}p_{X}(tw)p_{W}(w)w\text{d}w \\ &\quad\space\,=\quad\space\, \int_{0}^{+\infty} \frac{1}{\sqrt{2\pi}}e^{-\frac{t^2w^2}{2}}\cdot \frac{1}{\Gamma(\frac{n}{2})}2^{1-\frac{n}{2}}n^{\frac{n}{2}} e^{-\frac{nw^2}{2}}w^{n-1}\cdot w\text{d}w \\ &\quad\space\,=\quad\space\, \frac{1}{\sqrt{\pi}\cdot \Gamma(\frac{n}{2})}2^{\frac{1-n}{2}}n^{\frac{n}{2}} \int_{0}^{+\infty}e^{-\frac{n+t^2}{2}w^2}w^n\text{d}w \\ &\overset{w=\sqrt{\frac{2z}{n+t^2}}}{=} \frac{1}{\sqrt{\pi}\cdot\Gamma(\frac{n}{2})}2^{\frac{1-n}{2}}n^{\frac{n}{2}}\cdot \frac{1}{2}(\frac{2}{n+t^2})^{\frac{n+1}{2}} \int_{0}^{+\infty}e^{-z}z^{\frac{n-1}{2}}\text{d}z \\ &\quad\space\,=\quad\space\, \frac{\Gamma(\frac{n+1}{2})}{\sqrt{\pi}\cdot \Gamma(\frac{n}{2})}\cdot n^{\frac{n}{2}}(\frac{1}{n+t^2})^{\frac{n+1}{2}} \\ &\quad\space\,=\quad\space\, \frac{\Gamma(\frac{n+1}{2})}{\sqrt{n\pi}\cdot \Gamma(\frac{n}{2})} (1+\frac{t^2}{n})^{-\frac{n+1}{2}} \thinspace。 \end{aligned} pT(t) = +p(tw,w)wdw = +pX(tw)pW(w)wdw = 0+pX(tw)pW( w ) w d w = 0+2 p.m 1e2t2w _2C (2n)1212nn2ne2nw2wn1wdw = Pi C (2n)1221nn2n0+e2n+t2w2w _n dw=w=n+t22z _ Pi C (2n)1221nn2n21(n+t22)2n+10+ezz2n1dz = Pi C (2n)C (2n+1)n2n(n+t21)2n+1 = nπ C (2n)C (2n+1)(1+nt2)2n+1The derivation is complete.

Guess you like

Origin blog.csdn.net/Qmj2333333/article/details/125117668