Appendix C — Distributions of Random Variables

This appendix provides an overview of probability distributions commonly used in psychometric modeling.

C.1 Discrete distributions

C.1.1 Bernoulli distribution

The Bernoulli distribution describes a single trial with two possible outcomes: success (1) with probability \(\pi\) and failure (0) with probability \(1 - \pi\).

\[ P(Y = y) = \pi^y (1 - \pi)^{1-y}, \quad y \in \{0, 1\} \tag{C.1}\]

Properties:

  • Mean: \(E(Y) = \pi\)
  • Variance: \(\text{Var}(Y) = \pi(1 - \pi)\)

This distribution is fundamental for modeling binary item responses.

C.1.2 Binomial distribution

The binomial distribution describes the number of successes in \(n\) independent Bernoulli trials, each with success probability \(\pi\). We write \(X \sim \text{Binomial}(n, \pi)\).

\[ P(X = x) = \binom{n}{x} \pi^x (1 - \pi)^{n-x}, \quad x \in \{0, 1, \ldots, n\} \tag{C.2}\]

Properties:

  • Mean: \(E(X) = n\pi\)
  • Variance: \[ \text{Var}(X) = n\pi(1 - \pi) \tag{C.3}\]

The binomial distribution is used when modeling total test scores under the assumption of equal item difficulties and local independence.

In R:

# Probability mass function
x <- 0:20
pmf <- dbinom(x, size = 20, prob = 0.6)

barplot(pmf, names.arg = x, col = "steelblue",
        xlab = "Number of successes", ylab = "Probability",
        main = "Binomial(20, 0.6)")
(a) Binomial distribution with n=20 and π=0.6.
Figure C.1
# Mean and variance
n <- 20
pi <- 0.6
c(mean = n * pi, variance = n * pi * (1 - pi))
    mean variance 
    12.0      4.8 

C.2 Continuous distributions

C.2.1 Normal distribution

The normal distribution (also called Gaussian distribution) is the most important continuous distribution. We write \(X \sim \mathcal{N}(\mu, \sigma^2)\) for a normal random variable with mean \(\mu\) and variance \(\sigma^2\).

The probability density function (PDF) is:

\[ f(x) = \frac{1}{\sigma\sqrt{2\pi}} \exp\left( -\frac{(x - \mu)^2}{2\sigma^2} \right) \tag{C.4}\]

Properties:

  • Mean: \(E(X) = \mu\)
  • Variance: \(\text{Var}(X) = \sigma^2\)
  • Symmetric around the mean
  • 68-95-99.7 rule: Approximately 68%, 95%, and 99.7% of values lie within 1, 2, and 3 standard deviations of the mean

The standard normal distribution has \(\mu = 0\) and \(\sigma^2 = 1\), denoted \(Z \sim \mathcal{N}(0, 1)\).

In R:

# Density function
x <- seq(-4, 4, length.out = 200)
y <- dnorm(x, mean = 0, sd = 1)

plot(x, y, type = "l", lwd = 2, col = "steelblue",
     xlab = "x", ylab = "Density",
     main = "Standard Normal Distribution N(0, 1)")
Figure C.2: Standard normal distribution with shaded areas.
# Quantiles for confidence intervals
qnorm(c(0.025, 0.975))  # 95% CI boundaries
[1] -1.959964  1.959964
qnorm(c(0.005, 0.995))  # 99% CI boundaries
[1] -2.575829  2.575829

C.2.2 Chi-square distribution

The chi-square distribution with \(k\) degrees of freedom, denoted \(\chi^2_k\), arises as the distribution of the sum of \(k\) squared independent standard normal random variables.

\[ X = \sum_{i=1}^{k} Z_i^2, \quad Z_i \sim \mathcal{N}(0, 1) \tag{C.5}\]

Properties:

  • Mean: \(E(X) = k\)
  • Variance: \(\text{Var}(X) = 2k\)
  • Always positive
  • Right-skewed (becomes more symmetric as \(k\) increases)

The chi-square distribution is used in likelihood ratio tests and goodness-of-fit tests.

In R:

x <- seq(0, 30, length.out = 200)
plot(x, dchisq(x, df = 2), type = "l", lwd = 2, col = "red",
     xlab = "x", ylab = "Density", ylim = c(0, 0.25),
     main = "Chi-square Distributions")
lines(x, dchisq(x, df = 5), lwd = 2, col = "blue")
lines(x, dchisq(x, df = 10), lwd = 2, col = "darkgreen")
legend("topright", legend = c("df=2", "df=5", "df=10"),
       col = c("red", "blue", "darkgreen"), lwd = 2)
Figure C.3: Chi-square distributions with different degrees of freedom.

C.2.3 Student’s t-distribution

The Student’s t-distribution with \(\nu\) degrees of freedom, denoted \(t_\nu\), arises as the distribution of the ratio of a standard normal variable to the square root of a chi-square variable divided by its degrees of freedom.

\[ T = \frac{Z}{\sqrt{\chi^2_\nu / \nu}} \tag{C.6}\]

Properties:

  • Mean: \(E(X) = 0\) (for \(\nu > 1\))
  • Variance: \(\text{Var}(X) = \frac{\nu}{\nu - 2}\) (for \(\nu > 2\))
  • Symmetric around 0
  • Heavier tails than the normal distribution
  • Approaches normal distribution as \(\nu \to \infty\)

The t-distribution is used for t-tests and confidence intervals when the population variance is unknown.

In R:

x <- seq(-4, 4, length.out = 200)
plot(x, dnorm(x), type = "l", lwd = 2, col = "black",
     xlab = "x", ylab = "Density",
     main = "t-Distributions vs Normal")
lines(x, dt(x, df = 3), lwd = 2, col = "red")
lines(x, dt(x, df = 10), lwd = 2, col = "blue")
legend("topright", legend = c("Normal", "t(df=3)", "t(df=10)"),
       col = c("black", "red", "blue"), lwd = 2)
Figure C.4: Student’s t-distributions compared to standard normal.

C.2.4 F-distribution

The F-distribution with degrees of freedom \(d_1\) and \(d_2\), denoted \(F_{d_1, d_2}\), arises as the distribution of the ratio of two independent chi-square variables, each divided by their degrees of freedom.

\[ F = \frac{\chi^2_{d_1} / d_1}{\chi^2_{d_2} / d_2} \tag{C.7}\]

Properties:

  • Always positive
  • Right-skewed
  • Used in ANOVA and variance ratio tests

In R:

x <- seq(0, 5, length.out = 200)
plot(x, df(x, df1 = 5, df2 = 20), type = "l", lwd = 2, col = "steelblue",
     xlab = "x", ylab = "Density",
     main = "F(5, 20) Distribution")
Figure C.5: F-distribution with different degrees of freedom.

C.3 R functions for distributions

R provides four functions for each distribution:

Prefix Function Description
d dnorm(), dbinom(), etc. Density/probability mass function
p pnorm(), pbinom(), etc. Cumulative distribution function
q qnorm(), qbinom(), etc. Quantile function (inverse CDF)
r rnorm(), rbinom(), etc. Random number generation

Examples:

# Normal distribution
dnorm(0, mean = 0, sd = 1)  # Density at x = 0
[1] 0.3989423
pnorm(1.96)                  # P(Z <= 1.96)
[1] 0.9750021
qnorm(0.975)                 # 97.5th percentile
[1] 1.959964
rnorm(5, mean = 0, sd = 1)   # 5 random values
[1] -0.7064627 -1.0130708  0.4829202  1.2553493 -0.6037007
# Binomial distribution
dbinom(10, size = 20, prob = 0.5)  # P(X = 10)
[1] 0.1761971
pbinom(10, size = 20, prob = 0.5)  # P(X <= 10)
[1] 0.5880985