jackknife - Jackknife sampling

Syntax

jackstat = jackknife(jackfun,...)

Description

jackstat = jackknife(jackfun,...) draws jackknife data samples, computes statistics on each sample using the function jackfun, and returns the results in the matrix jackstat. jackfun is a function handle specified with @. Each row of jackstat contains the results of applying jackfun to one jackknife sample. If jackfun returns a matrix or array, this output is converted to a row vector for storage in jackstat.

The third and later input arguments to jackknife are scalars, column vectors, or matrices that are used to create inputs to jackfun. jackknife creates each jackknife sample by sampling with replacement from the rows of the nonscalar data arguments (these must have the same number of rows). Scalar data are passed to jackfun unchanged.

Example

Estimate the bias of the MLE variance estimator of random samples taken from the vector y using jackknife. The bias has a known formula in this problem, so you can compare the jackknife value to this formula.

y = exprnd(5,100,1);
m = jackknife(@var,y,1);
n = length(y);

bias = var(y,1)-var(y,0) % Bias formula
bias =
   -0.2069

jbias = (n-1)*(mean(m)-var(y,1)) % Jackknife estimate
jbias =
   -0.2069

See Also

bootstrp, random, randsample, hist, ksdensity

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS