Statistical Computing for Data Analysis
So far, we have used the bootstrap to approximate a sampling distribution by resampling with replacement.
The jackknife takes a different approach.
Instead of drawing many bootstrap samples, we:
The jackknife is a deterministic resampling method based on systematic deletion.
Suppose our statistic of interest is \(\widehat{\theta}\), computed from \(n\) observations.
For each \(i = 1,\dots,n\), let
\[ \widehat{\theta}_{(-i)} = \text{the statistic computed after removing observation } i. \]
This gives \(n\) leave-one-out estimates.
Let
\[ \bar{\theta}_{(\cdot)} = \frac{1}{n}\sum_{i=1}^n \widehat{\theta}_{(-i)}. \]
These values are the basis for jackknife estimates of bias and standard error.
A standard jackknife estimate of bias is
\[ \widehat{\mathrm{bias}}_{\text{jack}} = (n-1)\big(\bar\theta_{(\cdot)} - \widehat\theta\big). \]
This comes from a second-order term in a Taylor-type expansion,.
A jackknife bias-corrected estimator is
\[ \widehat\theta_{\text{jack}} = \widehat\theta - \widehat{\mathrm{bias}}_{\text{jack}}. \]
A standard jackknife estimate of standard error is
\[ \widehat{\mathrm{SE}}_{\text{jack}} = \left(\tfrac{n-1}{n}\sum_{i=1}^n \left(\widehat\theta_{(-i)} - \bar\theta_{(\cdot)}\right)^2 \right)^{1/2} \]
The jackknife can be used for:
It tends to work best for smooth statistics.
Both methods estimate bias, but the bootstrap does so by resampling with replacement, whereas the jackknife uses leave-one-out samples.
We can use the jackknife to estimate a standard error.
Using the Auto data, let
\[ \widehat\theta = \text{corr}(\texttt{horsepower}, \texttt{mpg}). \]
Then we leave out one row at a time and recompute the sample correlation.
data(Auto)
dat <- Auto[, c("horsepower", "mpg")]
n <- nrow(dat)
theta_hat <- cor(dat$horsepower, dat$mpg)
theta_loo <- numeric(n)
for (i in 1:n) {
dat_i <- dat[-i, ]
theta_loo[i] <- cor(dat_i$horsepower, dat_i$mpg)
}
theta_bar <- mean(theta_loo)
se_jack <- sqrt((n - 1) / n * sum((theta_loo - theta_bar)^2))
theta_hat## [1] -0.7784268
## [1] 0.01541941
–> then jackknife is attractive.
–> then bootstrap is usually better.