3.4 Parametric bootstrap

Here we discuss an alternative to the (non-parametric) bootstrap from the previous section.

The main idea of the bootstrap was that the empirical distribution \(\hat F\) is (hopefully) close to the actual distribution \(F\). Another method of finding an approximation to \(F\) is to take some family of distributions, parametrised by a parameter \(\theta\), \(F_\theta\), and find the \(\theta\) that agrees the best with the observed sample. For example by choosing \(\theta = \hat\theta_{ML}\).

Then we proceed as before. We may now sample from \(\hat F = F_{\hat\theta}\) and estimate variances and construct confidence intervals as before.

As an example, let us say that we have a random sample from \(\mathsf N(\mu,\sigma^2)\) and wish to estimate the variance of the median of the sample. We then estimate \(\mu\) and \(\sigma^2\) with the ML-estimates and let \(\hat F = \mathsf N(\hat \mu,\hat \sigma^2)\).

Implementing this is not complicated.

T <- median
n <- nrow(data.df)
B <- 1000

mu.hat <- mean(data.df$x)
sigma.hat <- sd(data.df$x)

for (i in 1:B) {
  bootstrap.sample <- rnorm(n, mean = mu.hat, sd = sigma.hat)
  tstar[i] <- T(bootstrap.sample)
}

sd(tstar)
## [1] 0.1272958