MATLAB Examples

Jackknife Resampling

Similar to the bootstrap is the jackknife, which uses resampling to estimate the bias of a sample statistic. Sometimes it is also used to estimate standard error of the sample statistic. The jackknife is implemented by the Statistics and Machine Learning Toolbox™ function jackknife.

The jackknife resamples systematically, rather than at random as the bootstrap does. For a sample with n points, the jackknife computes sample statistics on n separate samples of size n-1. Each sample is the original data with a single observation omitted.

In the bootstrap example, you measured the uncertainty in estimating the correlation coefficient. You can use the jackknife to estimate the bias, which is the tendency of the sample correlation to over-estimate or under-estimate the true, unknown correlation. First compute the sample correlation on the data.

load lawdata
rhohat = corr(lsat,gpa)
rhohat =


Next compute the correlations for jackknife samples, and compute their mean.

rng default;  % For reproducibility
jackrho = jackknife(@corr,lsat,gpa);
meanrho = mean(jackrho)
meanrho =


Now compute an estimate of the bias.

n = length(lsat);
biasrho = (n-1) * (meanrho-rhohat)
biasrho =


The sample correlation probably underestimates the true correlation by about this amount.