[1] 0.02506859
[1] 0.04995313
[1] 0.05001557
The Standard Normal Distribution (\(Z \sim N(0, 1)\)) serves as the fundamental building block for a massive family of continuous probability distributions.
In R, these are evaluated using dnorm(), pnorm(), and qnorm().
If \(Z_1, Z_2, \dots, Z_k\) are \(k\) independent standard normal random variables, the sum of their squares follows a Chi-Square distribution with \(k\) degrees of freedom (\(df\)):
\[X = \sum_{i=1}^k Z_i^2 \sim \chi^2_k\]
For \(x \ge 0\): \[f(x) = \frac{1}{2^{k/2} \Gamma(k/2)} x^{(k/2) - 1} e^{-x/2}\]
For a real number \(n > 0\), it is defined via the improper integral: \[\Gamma(n) = \int_0^\infty x^{n-1} e^{-x} \, dx\]
\[\mu = E(X) = k\]
\[\sigma^2 = Var(X) = 2k\]
If \(Z \sim N(0,1)\) and \(U \sim \chi^2_k\) are independent random variables, the random variable \(T\) below follows a Student’s \(t\) distribution with \(k\) degrees of freedom:
\[T = \frac{Z}{\sqrt{U/k}} \sim t_k\]
For \(-\infty < t < \infty\): \[f(t) = \frac{\Gamma(\frac{k+1}{2})}{\sqrt{k\pi} \, \Gamma(\frac{k}{2})} \left(1 + \frac{t^2}{k}\right)^{-\frac{k+1}{2}}\]
\[\mu = E(T) = 0 \quad (\text{defined only for } k > 1)\]
\[\sigma^2 = Var(T) = \frac{k}{k-2} \quad (\text{defined only for } k > 2)\]
Note: If \(k \le 1\), the mean is undefined. If \(1 < k \le 2\), the variance is infinite.
If \(U_1 \sim \chi^2_{d_1}\) and \(U_2 \sim \chi^2_{d_2}\) are independent chi-square random variables, the ratio of their scaled versions follows an \(F\) distribution with \((d_1, d_2)\) degrees of freedom:
\[F = \frac{U_1 / d_1}{U_2 / d_2} \sim F_{d_1, d_2}\]
For \(x \ge 0\): \[f(x) = \frac{\Gamma(\frac{d_1+d_2}{2})}{\Gamma(\frac{d_1}{2})\Gamma(\frac{d_2}{2})} \left(\frac{d_1}{d_2}\right)^{\frac{d_1}{2}} x^{\frac{d_1}{2} - 1} \left(1 + \frac{d_1}{d_2}x\right)^{-\frac{d_1+d_2}{2}}\]
The moments of the \(F\) distribution depend strictly on the denominator degrees of freedom (\(d_2\)):
\[\mu = E(F) = \frac{d_2}{d_2 - 2} \quad (\text{defined only for } d_2 > 2)\]
\[\sigma^2 = Var(F) = \frac{2 d_2^2 (d_1 + d_2 - 2)}{d_1 (d_2 - 2)^2 (d_2 - 4)} \quad (\text{defined only for } d_2 > 4)\]
Every continuous distribution in R shares a clean, consistent naming convention consisting of a single prefix combined with the distribution’s core identifier:
| Function Purpose | Prefix | Normal | Chi-Square | Student’s \(t\) | \(F\) |
|---|---|---|---|---|---|
| PDF (Density / Height) | d |
dnorm() |
dchisq() |
dt() |
df() |
| CDF (Lower-tail Probability) | p |
pnorm() |
pchisq() |
pt() |
pf() |
| Function Purpose | Prefix | Normal | Chi-Square | Student’s \(t\) | \(F\) |
|---|---|---|---|---|---|
| Quantile (Inverse CDF Value) | q |
qnorm() |
qchisq() |
qt() |
qf() |
| Random Generation (Simulation) | r |
rnorm() |
rchisq() |
rt() |
rf() |
To calculate \(P(X \le x)\), use the p prefix. For upper-tail probabilities \(P(X > x)\), use lower.tail = FALSE.
[1] 0.02506859
[1] 0.04995313
[1] 0.05001557
To calculate the threshold value corresponding to a specific probability percentile, use the q prefix.
[1] 11.0705
[1] 2.085963
[1] 2.838745
A powerful way to understand the \(t\), \(\chi^2\), and \(F\) distributions is to simulate thousands of random draws (empirical data) and compare them directly against their exact mathematical equations (theoretical PDFs).
In R, we can seamlessly achieve this overlay by: 1. Drawing samples using the r family of functions (rt(), rchisq(), rf()). 2. Plotting an empirical density histogram using ggplot2. 3. Layering the exact theoretical density curve using stat_function().
Below, we simulate 10,000 draws from a \(t\)-distribution with 5 degrees of freedom. Fatter tails are expected due to low degrees of freedom.
library(ggplot2)
set.seed(42)
# 1. Simulate data
t_data <- data.frame(value = rt(n = 10000, df = 5))
# 2. Graph with theoretical PDF overlay
ggplot(t_data, aes(x = value)) +
geom_histogram(aes(y = after_stat(density)), bins = 60,
fill = "skyblue", color = "black", alpha = 0.6) +
stat_function(fun = dt, args = list(df = 5),
color = "darkblue", linewidth = 1.2) +
labs(title = "Simulated t-Distribution (df = 5)",
x = "t-value", y = "Density") +
xlim(-5, 5) + theme_minimal()Here, we simulate 10,000 draws from a \(\chi^2\) distribution with 4 degrees of freedom. Notice that the values are strictly positive and skewed heavily to the right.
Finally, we simulate 10,000 draws from an \(F\) distribution with \(df_1 = 5\) and \(df_2 = 10\). This ratio of scaled variances generates a sharp right-skewed peak.
The shapes of the \(t\), \(\chi^2\), and \(F\) distributions are entirely controlled by their parameters, known as degrees of freedom (\(df\)).
To visually understand how changing these parameters alters their skewness, tail thickness, and convergence properties, we can simulate large datasets across multiple \(df\) values and plot them side by side using ggplot2 faceting.
As \(df\) increases, the heavy tails decrease, and the distribution converges toward the Standard Normal distribution (\(N(0,1)\)).
library(ggplot2)
library(dplyr)
set.seed(42)
N <- 5000
# Simulate across different degrees of freedom
t_v1 <- data.frame(value = rt(N, df = 2), df_label = "df = 2 (Heavy Tails)")
t_v2 <- data.frame(value = rt(N, df = 5), df_label = "df = 5")
t_v3 <- data.frame(value = rt(N, df = 30), df_label = "df = 30 (Approaching Normal)")
t_combined <- bind_rows(t_v1, t_v2, t_v3) %>%
mutate(df_label = factor(df_label, levels = c("df = 2 (Heavy Tails)", "df = 5", "df = 30 (Approaching Normal)")))
# Graph with theoretical curves superimposed
ggplot(t_combined, aes(x = value)) +
geom_histogram(aes(y = after_stat(density)), bins = 60, fill = "skyblue", color = "black", alpha = 0.5) +
stat_function(fun = dt, args = list(df = 2), data = filter(t_combined, df_label == "df = 2 (Heavy Tails)"), color = "darkblue", linewidth = 1) +
stat_function(fun = dt, args = list(df = 5), data = filter(t_combined, df_label == "df = 5"), color = "darkblue", linewidth = 1) +
stat_function(fun = dt, args = list(df = 30), data = filter(t_combined, df_label == "df = 30 (Approaching Normal)"), color = "darkblue", linewidth = 1) +
facet_wrap(~df_label) + xlim(-4, 4) + theme_minimal() + labs(title = "t-Distribution Shape Shifts", y = "Density")At very low \(df\), the distribution is highly asymmetrical and spikes near zero. As \(df\) grows, the distribution shifts right, spreads out, and becomes increasingly symmetric.
The \(F\) distribution shape depends on both numerator (\(df_1\)) and denominator (\(df_2\)) parameters. Altering either changes the prominence of its right-skewed peak.
More about the Distributions Ross, S. M. (2014). A First Course in Probability (9th ed.). Pearson.
Computational Software: R Core Team (2026). R: A Language and Environment for Statistical Computing. R Foundation for Statistical Computing. Vienna, Austria. Available at https://www.R-project.org/.