Generate 100 samples of size 30 from \(\chi^2\) distribution with 2 degrees of freedom

Calculate and store 100 simulated sample means and minima:

library(ggplot2)

n <- 100

df <- data.frame(mean = numeric(n), min = numeric(n))

for (i in 1:n) {
  a <- rchisq(30, df = 2)

  df$mean[i] <- mean(a)
  df$min[i] <- min(a)
}
ggplot(df, aes(mean)) +
  geom_histogram() +
  labs(title = expression(paste("Histogram of sample means randomly generated from ", 
                                chi^2, "(2) distribution")),
       x = "Sample mean", y = "Frequency")

ggplot(df, aes(min)) +
  geom_histogram() +
  labs(title = expression(paste("Histogram of sample minima randomly generated from ", 
                                chi^2, "(2) distribution")),
       x = "Sample minimum", y = "Frequency")

The sampling distribution of the mean is approximately normally distributed and demonstrates the central limit theorem. The sampling distribution of the minimum approaches the probability density function \(f(x) = 15e^{-15x}\) as derived and plotted below.

\(\textrm{CDF of }\chi^2(2):\)
\(F(x; 2) = 1 - e^{-x/2}\)
\(\textrm{CDF of }min(\chi^2(2)):\)
\(1 − [1 − F(x; 2)]^n\)
\(1 − [1 − F(x; 2)]^{30}\)
\(1 - [1 - (1 - e^{-x/2})]^{30}\)
\(1 - [e^{-x/2})]^{30} = 1 - e^{-15x}\)
\(\textrm{PDF of }min(\chi^2(2)):\)
\(\frac{d}{dx}(1 - e^{-15x}) = 15e^{-15x}\)

ggplot(df, aes(min)) +
  geom_histogram() +
  stat_function(fun=function(x) 15 * exp(1)^(-15 * x),
                color = "red") +
  labs(title = expression(paste("Histogram of sample minima randomly generated from ", 
                                chi^2, "(2) distribution")),
       x = "Sample minimum", y = "Frequency") 

References