|
| 1 | +--- |
| 2 | +layout: proof |
| 3 | +mathjax: true |
| 4 | + |
| 5 | +author: "Joram Soch" |
| 6 | +affiliation: "BCCN Berlin" |
| 7 | +e_mail: "joram.soch@bccn-berlin.de" |
| 8 | +date: 2021-10-12 08:15:00 |
| 9 | + |
| 10 | +title: "Probability density function of the t-distribution" |
| 11 | +chapter: "Probability Distributions" |
| 12 | +section: "Univariate continuous distributions" |
| 13 | +topic: "t-distribution" |
| 14 | +theorem: "Probability density function" |
| 15 | + |
| 16 | +sources: |
| 17 | + - authors: "Computation Empire" |
| 18 | + year: 2021 |
| 19 | + title: "Student's t Distribution: Derivation of PDF" |
| 20 | + in: "YouTube" |
| 21 | + pages: "retrieved on 2021-10-11" |
| 22 | + url: "https://www.youtube.com/watch?v=6BraaGEVRY8" |
| 23 | + |
| 24 | +proof_id: "P263" |
| 25 | +shortcut: "t-pdf" |
| 26 | +username: "JoramSoch" |
| 27 | +--- |
| 28 | + |
| 29 | + |
| 30 | +**Theorem:** Let $T$ be a [random variable](/D/rvar) following a [t-distribution](/D/t): |
| 31 | + |
| 32 | +$$ \label{eq:t} |
| 33 | +T \sim t(\nu) \; . |
| 34 | +$$ |
| 35 | + |
| 36 | +Then, the [probability density function](/D/pdf) of $T$ is |
| 37 | + |
| 38 | +$$ \label{eq:t-pdf} |
| 39 | +f_T(t) = \frac{\Gamma\left( \frac{\nu+1}{2} \right)}{\Gamma\left( \frac{\nu}{2} \right) \cdot \sqrt{\nu \pi}} \cdot \left( \frac{t^2}{\nu}+1 \right)^{-\frac{\nu+1}{2}} \; . |
| 40 | +$$ |
| 41 | + |
| 42 | + |
| 43 | +**Proof:** A [t-distributed random variable](/D/t) is defined as the ratio of a [standard normal random variable](/D/snorm) and the square root of a [chi-squared random variable](/D/chi2), divided by its [degrees of freedom](/D/dof) |
| 44 | + |
| 45 | +$$ \label{eq:t-def} |
| 46 | +X \sim \mathcal{N}(0,1), \; Y \sim \chi^2(\nu) \quad \Rightarrow \quad T = \frac{X}{\sqrt{Y/\nu}} \sim t(\nu) |
| 47 | +$$ |
| 48 | + |
| 49 | +where $X$ and $Y$ are [independent of each other](/D/ind). |
| 50 | + |
| 51 | +The [probability density function](/P/norm-pdf) of the [standard normal distribution](/D/snorm) is |
| 52 | + |
| 53 | +$$ \label{eq:snorm-pdf} |
| 54 | +f_X(x) = \frac{1}{\sqrt{2 \pi}} \cdot e^{-\frac{x^2}{2}} |
| 55 | +$$ |
| 56 | + |
| 57 | +and the [probability density function of the chi-squared distribution](/P/chi2-pdf) is |
| 58 | + |
| 59 | +$$ \label{eq:chi2-pdf} |
| 60 | +f_Y(y) = \frac{1}{\Gamma\left( \frac{\nu}{2} \right) \cdot 2^{\nu/2}} \cdot y^{\frac{\nu}{2}-1} \cdot e^{-\frac{y}{2}} \; . |
| 61 | +$$ |
| 62 | + |
| 63 | +Define the random variables $T$ and $W$ as functions of $X$ and $Y$ |
| 64 | + |
| 65 | +$$ \label{eq:TW-XY} |
| 66 | +\begin{split} |
| 67 | +T &= X \cdot \sqrt{\frac{\nu}{Y}} \\ |
| 68 | +W &= Y \; , |
| 69 | +\end{split} |
| 70 | +$$ |
| 71 | + |
| 72 | +such that the inverse functions $X$ and $Y$ in terms of $T$ and $W$ are |
| 73 | + |
| 74 | +$$ \label{eq:XY-TW} |
| 75 | +\begin{split} |
| 76 | +X &= T \cdot \sqrt{\frac{W}{\nu}} \\ |
| 77 | +Y &= W \; . |
| 78 | +\end{split} |
| 79 | +$$ |
| 80 | + |
| 81 | +This implies the following Jacobian matrix and determinant: |
| 82 | + |
| 83 | +$$ \label{eq:XY-TW-jac} |
| 84 | +\begin{split} |
| 85 | +J &= \left[ \begin{matrix} |
| 86 | +\frac{\mathrm{d}X}{\mathrm{d}T} & \frac{\mathrm{d}X}{\mathrm{d}W} \\ |
| 87 | +\frac{\mathrm{d}Y}{\mathrm{d}T} & \frac{\mathrm{d}Y}{\mathrm{d}W} |
| 88 | +\end{matrix} \right] |
| 89 | += \left[ \begin{matrix} |
| 90 | +\sqrt{\frac{W}{\nu}} & \frac{T}{2 \sqrt{W/\nu}} \\ |
| 91 | +0 & 1 |
| 92 | +\end{matrix} \right] \\ |
| 93 | +\lvert J \rvert &= \sqrt{\frac{W}{\nu}} \; . |
| 94 | +\end{split} |
| 95 | +$$ |
| 96 | + |
| 97 | +Because $X$ and $Y$ are [independent](/D/ind), the [joint density](/D/dist-joint) of $X$ and $Y$ is [equal to the product](/P/prob-ind) of the [marginal densities](/D/dist-marg): |
| 98 | + |
| 99 | +$$ \label{eq:f-XY} |
| 100 | +f_{X,Y}(x,y) = f_X(x) \cdot f_Y(y) \; . |
| 101 | +$$ |
| 102 | + |
| 103 | +With the [probability density function of an invertible function](/P/pdf-invfct), the [joint density](/D/dist-joint) of $T$ and $W$ can be derived as: |
| 104 | + |
| 105 | +$$ \label{eq:f-TW-s1} |
| 106 | +f_{T,W}(t,w) = f_{X,Y}(x,y) \cdot \lvert J \rvert \; . |
| 107 | +$$ |
| 108 | + |
| 109 | +Substituting \eqref{eq:XY-TW} into \eqref{eq:snorm-pdf} and \eqref{eq:chi2-pdf}, and then with \eqref{eq:XY-TW-jac} into \eqref{eq:f-TW-s1}, we get: |
| 110 | + |
| 111 | +$$ \label{eq:f-TW-s2} |
| 112 | +\begin{split} |
| 113 | +f_{T,W}(t,w) &= f_X\left( t \cdot \sqrt{\frac{w}{\nu}} \right) \cdot f_Y(w) \cdot \lvert J \rvert \\ |
| 114 | +&= \frac{1}{\sqrt{2 \pi}} \cdot e^{-\frac{\left( t \cdot \sqrt{\frac{w}{\nu}} \right)^2}{2}} \cdot \frac{1}{\Gamma\left( \frac{\nu}{2} \right) \cdot 2^{\nu/2}} \cdot w^{\frac{\nu}{2}-1} \cdot e^{-\frac{w}{2}} \cdot \sqrt{\frac{w}{\nu}} \\ |
| 115 | +&= \frac{1}{\sqrt{2 \pi \nu} \cdot \Gamma\left( \frac{\nu}{2} \right) \cdot 2^{\nu/2}} \cdot w^{\frac{\nu+1}{2}-1} \cdot e^{-\frac{w}{2} \left( \frac{t^2}{\nu} + 1 \right)} \; . |
| 116 | +\end{split} |
| 117 | +$$ |
| 118 | + |
| 119 | +The [marginal density](/D/dist-marg) of $T$ can now be [obtained by integrating out](/D/dist-marg) $W$: |
| 120 | + |
| 121 | +$$ \label{eq:f-T-s1} |
| 122 | +\begin{split} |
| 123 | +f_T(t) &= \int_{0}^{\infty} f_{T,W}(t,w) \, \mathrm{d}w \\ |
| 124 | +&= \frac{1}{\sqrt{2 \pi \nu} \cdot \Gamma\left( \frac{\nu}{2} \right) \cdot 2^{\nu/2}} \cdot \int_{0}^{\infty} w^{\frac{\nu+1}{2}-1} \cdot \mathrm{exp}\left[ -\frac{1}{2}\left( \frac{t^2}{\nu}+1 \right) w \right] \, \mathrm{d}w \\ |
| 125 | +&= \frac{1}{\sqrt{2 \pi \nu} \cdot \Gamma\left( \frac{\nu}{2} \right) \cdot 2^{\nu/2}} \cdot \frac{\Gamma\left( \frac{\nu+1}{2} \right)}{\left[ \frac{1}{2}\left( \frac{t^2}{\nu}+1 \right) \right]^{(\nu+1)/2}} \cdot \int_{0}^{\infty} \frac{\left[ \frac{1}{2}\left( \frac{t^2}{\nu}+1 \right) \right]^{(\nu+1)/2}}{\Gamma\left( \frac{\nu+1}{2} \right)} \cdot w^{\frac{\nu+1}{2}-1} \cdot \mathrm{exp}\left[ -\frac{1}{2}\left( \frac{t^2}{\nu}+1 \right) w \right] \, \mathrm{d}w \; . |
| 126 | +\end{split} |
| 127 | +$$ |
| 128 | + |
| 129 | +At this point, we can recognize that the integrand is equal to the [probability density function of a gamma distribution](/P/gam-pdf) with |
| 130 | + |
| 131 | +$$ \label{eq:f-W-gam-ab} |
| 132 | +a = \frac{\nu+1}{2} \quad \text{and} \quad b = \frac{1}{2}\left( \frac{t^2}{\nu}+1 \right) \; , |
| 133 | +$$ |
| 134 | + |
| 135 | +and [because a probability density function integrates to one](/D/pdf), we finally have: |
| 136 | + |
| 137 | +$$ \label{eq:f-T-s2} |
| 138 | +\begin{split} |
| 139 | +f_T(t) &= \frac{1}{\sqrt{2 \pi \nu} \cdot \Gamma\left( \frac{\nu}{2} \right) \cdot 2^{\nu/2}} \cdot \frac{\Gamma\left( \frac{\nu+1}{2} \right)}{\left[ \frac{1}{2}\left( \frac{t^2}{\nu}+1 \right) \right]^{(\nu+1)/2}} \\ |
| 140 | +&= \frac{\Gamma\left( \frac{\nu+1}{2} \right)}{\Gamma\left( \frac{\nu}{2} \right) \cdot \sqrt{\nu \pi}} \cdot \left( \frac{t^2}{\nu}+1 \right)^{-\frac{\nu+1}{2}} \; . |
| 141 | +\end{split} |
| 142 | +$$ |
0 commit comments