8.5 The Jackknife

Let θ denote a scalar parameter of interest. It could be a scalar parameter of the GWN model (e.g. μ or σ) or it could be a scalar function of the parameters of the GWN model (e.g. VaR or SR). Let ˆθ denote the plug-in estimator of θ. The goal is to compute a numerical estimated standard error for ˆθ, ^se(ˆθ), using the jackknife resampling method.

The jackknife resampling method utilizes T resamples of the original data {Rt}Tt=1. The resamples are created by leaving out a single observation. For example, the first jackknife resample leaves out the first observation and is given by {Rt}Tt=2. This sample has T1 observations. In general, the tth jackknife resample leaves out the tth return Rt for tT. Now, on each of the t=1,,T jackknife resamples you compute an estimate of θ. Denote this jackknife estimate ˆθt to indicate that θ is estimated using the resample that omits observation t. The estimator ˆθt is called the leave-one-out estimator of θ. Computing ˆθt for t=1,,T gives T leave-one-out estimators {ˆθt}Tt=1.

The jackknife estimator of ^se(ˆθ) is the scaled standard deviation of {ˆθt}Tt=1:

^sejack(ˆθ)=T1TTt=1(ˆθtˉθ)2,

where ˉθ=T1Tt=1ˆθt is the sample mean of {ˆθt}Tt=1. The estimator (8.10) is easy to compute and does not require any analytic calculations from the asymptotic distribution of ˆθ.

The intuition for the jackknife standard error formula can be illustrated by considering the jackknife standard error estimate for the sample mean ˆθ=ˆμ. We know that the analytic estimated squared standard error for ˆμ is

^se(ˆμ)2=ˆσ2T=1T1T1Tt=1(Rtˆμ)2.

Now consider the jackknife squared standard error for ˆμ:

^sejack(ˆμ)2=T1TTt=1(ˆμtˉμ)2,

where ˉμ=T1Tt=1ˆμt. Here, we will show that ^se(ˆμ)2=^sejack(ˆμ)2.

First, note that

ˆμt=1T1jtRj=1T1(Tj=1RjRt)=1T1(TˆμRt)=TT1ˆμ1T1Rt.

Next, plugging in the above to the definition of ˉμ we get

ˉμ=1TTj=1ˆμt=1TTt=1(TT1ˆμ1T1Rt)=1T1Tt=1ˆμ1T1T1Tt=1Rt=TT1ˆμ1T1ˆμ=ˆμ(TT11T1)=ˆμ.

Hence, the sample mean of ˆμt is ˆμ. Then we can write

ˆμtˉμ=ˆμtˆμ=TT1ˆμ1T1Rtˆμ=TT1ˆμ1T1RtT1T1ˆμ=1T1ˆμ1T1Rt=1T1(ˆμRt).

Using the above we can write

^sejack(ˆμ)2=T1TTt=1(ˆμtˉμ)2=T1T(1T1)2Tt=1(ˆμRt)2=1T1T1Tt=1(ˆμRt)2=1Tˆσ2=^se(ˆμ)2.

Example 2.22 (Jackknife standard error for ˆμ for Microsoft)

We can compute the leave-one-out estimates {ˆμt}Tt=1 using a simple for loop as follows:

n.obs = length(msftRetS)
muhat.loo = rep(0, n.obs)
for(i in 1:n.obs) {
  muhat.loo[i] = mean(msftRetS[-i])
}

In the above loop, msftRetS[-i] extracts all observations except observation i. The mean of the leave-one-out estimates is

mean(muhat.loo)
## [1] 0.00915

which is the sample mean of msftRetS. It is informative to plot a histogram of the leave-one-out estimates:

Histogram of leave-one-out estimator of $\mu$ for Microsoft.

Figure 8.1: Histogram of leave-one-out estimator of μ for Microsoft.

The white dotted line is at the point ˆμ=0.00915. The jackknife estimated standard error is the scaled standard deviation of the T ˆμt values:41

se.jack.muhat = sqrt(((n.obs - 1)^2)/n.obs)*sd(muhat.loo)
se.jack.muhat
## [1] 0.00774

This value is exactly the same as the analytic standard error:

se.muhatS
## [1] 0.00774

You can also compute jackknife estimated standard errors using the bootstrap function jackknife:

library(bootstrap)
muhat.jack = jackknife(coredata(msftRetS), mean)
names(muhat.jack)
## [1] "jack.se"     "jack.bias"   "jack.values" "call"

By default, jackknife() takes as input a vector of data and the name of an R function and returns a list with components related to the jackknife procedure. The component jack.values contains the leave-one-out estimators, and the component jack.se gives you the jackknife estimated standard error:

muhat.jack$jack.se
## [1] 0.00774

The fact that the jackknife standard error estimate for ˆμ equals the analytic standard error is main justification for using the jackknife to compute standard errors. For estimated parameters other than ˆμ and general estimated functions the jackknife standard errors are often numerically very close to the delta method standard errors. The following example illustrates this point for the example functions (8.1) - (8.4).

Example 2.25 (Jackknife standard errors for plug-in estimators of example functions)

Here, we use the bootstrap function jackknife() to compute jackknife estimated standard errors for the plug-in estimates of the example functions (8.1) - (8.4) and we compare the jackknife standard errors with the delta method standard errors. To use jackknife() with user-defined functions involving multiple parameters you must create the function such that the first input is an integer vector of index observations and the second input is the data. For example, a function for computing (8.1) to be passed to jackknife() is:

theta.f1 = function(x, xdata) {
  mu.hat = mean(xdata[x, ])
  sigma.hat = sd(xdata[x, ])
  fun.hat = mu.hat + sigma.hat*qnorm(0.05)
  fun.hat
}

To compute the jackknife estimated standard errors for the estimate of (8.1) use:

f1.jack = jackknife(1:n.obs, theta=theta.f1, coredata(msftRetS))
ans = cbind(f1.jack$jack.se, dm1$SE)
colnames(ans) = c("Jackknife", "Delta Method")
rownames(ans) = "f1"
ans
##    Jackknife Delta Method
## f1    0.0133       0.0119

Here, we see that the estimated jackknife standard error for f1(ˆθ) is very close to the delta method standard error computed earlier.

To compute the jackknife estimated standard error for f2(ˆθ) use:

theta.f2 = function(x, xdata, W0) {
  mu.hat = mean(xdata[x, ])
  sigma.hat = sd(xdata[x, ])
  fun.hat = -W0*(mu.hat + sigma.hat*qnorm(0.05))
  fun.hat
}
f2.jack = jackknife(1:n.obs, theta=theta.f2, coredata(msftRetS), W0)
ans = cbind(f2.jack$jack.se, dm2$SE)
colnames(ans) = c("Jackknife", "Delta Method")
rownames(ans) = "f2"
ans
##    Jackknife Delta Method
## f2      1329         1187

Again, the jackknife standard error is close to the delta method standard error.

To compute the jackknife estimated standard error for f3(ˆθ) use:

theta.f3 = function(x, xdata, W0) {
  mu.hat = mean(xdata[x, ])
  sigma.hat = sd(xdata[x, ])
  fun.hat = -W0*(exp(mu.hat + sigma.hat*qnorm(0.05)) - 1)
  fun.hat
}
f3.jack = jackknife(1:n.obs, theta=theta.f3, coredata(msftRetC), W0)
ans = cbind(f3.jack$jack.se, dm3$SE)
colnames(ans) = c("Jackknife", "Delta Method")
rownames(ans) = "f3"
ans
##    Jackknife Delta Method
## f3      1315          998

For log-normal VaR, the jackknife standard error is a bit larger than the delta method standard error.

Finally, to compute the jacknife estimated standard for the Sharpe ratio use:

theta.f4 = function(x, xdata, r.f) {
  mu.hat = mean(xdata[x, ])
  sigma.hat = sd(xdata[x, ])
  fun.hat = (mu.hat-r.f)/sigma.hat
  fun.hat
}
f4.jack = jackknife(1:n.obs, theta=theta.f4, coredata(msftRetS), r.f)
ans = cbind(f4.jack$jack.se, dm4$SE)
colnames(ans) = c("Jackknife", "Delta Method")
rownames(ans) = "f4"
ans
##    Jackknife Delta Method
## f4     0.076       0.0763

Here, the jackknife and delta method standard errors are very close.

8.5.1 The jackknife for vector-valued estimates

The jackknife can also be used to compute an estimated variance matrix of a vector-valued estimate of parameters. Let θ denote a k×1 vector of GWN model parameters (e.g. θ=(μ,σ)), and let ˆθ denote the plug-in estimate of θ. Let ˆθt denote the leave-one-out estimate of θ, and ˉθ=T1Tt=1ˆθt. Then the jackknife estimate of the k×k variance matrix ^var(ˆθ) is the scaled sample covariance of {ˆθt}Tt=1:

^varjack(ˆθ)=T1TTt=1(ˆθtˉθ)(ˆθtˉθ).

The jackknife estimated standard errors for the elements of ˆθ are given by the square root of the diagonal elements of ^varjack(ˆθ).

The same principle works for computing the estimated variance matrix of a vector of functions of GWN model parameters. Let f:RkRl with lk and define η=f(θ) denote a l×1 vector of functions of GWN model parameters. Let ˆη=f(ˆθ) denote the plug-in estimator of η. Let ˆηt denote the leave-one-out estimate of η, and ˉη=T1Tt=1ˆηt. Then the jackknife estimate of the l×l variance matrix ^var(ˆη) is the scaled sample covariance of {ˆηt}Tt=1:

^varjack(ˆη)=T1TTt=1(ˆηtˉη)(ˆηtˉη).

Example 3.8 (Jackknife variance estimate for ˆθ=(μ,σ) for Microsoft simple returns)

The bootstrap function jackknife() function only works for scalar-valued parameter estimates, so we have to compute the jackknife variance estimate by hand using a for loop. The R code is:

n.obs = length(msftRetS)
muhat.loo = rep(0, n.obs)
sigmahat.loo = rep(0, n.obs)
for(i in 1:n.obs) {
  muhat.loo[i] = mean(msftRetS[-i])
  sigmahat.loo[i] = sd(msftRetS[-i])
}
thetahat.loo = cbind(muhat.loo, sigmahat.loo)
colnames(thetahat.loo) = c("mu", "sigma")
varhat.jack = (((n.obs-1)^2)/n.obs)*var(thetahat.loo)
varhat.jack
##             mu    sigma
## mu    5.99e-05 1.49e-05
## sigma 1.49e-05 6.12e-05

The jackknife variance estimate is somewhat close to the analytic estimate:

var.thetahatS
##             mu    sigma
## mu    5.99e-05 0.00e+00
## sigma 0.00e+00 2.99e-05

Since the first element of ˆθ is ˆμ, the (1,1) elements of the two variance matrix estimates match exactly. However, the varhat.jack has non-zero off diagonal elements and the (2,2) element corresponding to ˆσ is considerably bigger than (2,2) element of the analytic estimate. Converting var.thetahatS to an estimated correlation matrix gives:

cov2cor(varhat.jack)
##          mu sigma
## mu    1.000 0.246
## sigma 0.246 1.000

Here, we see that the jackknife shows a small positive correlation between ˆμ and ˆσ whereas the analytic matrix shows a zero correlation.

8.5.2 Pros and Cons of the Jackknife

The jackknife gets its name because it is a useful statistical device.42 The main advantages (pros) of the jacknife are:

  • It is a good “quick and dirty” method for computing numerical estimated standard errors of estimates that does not rely on asymptotic approximations.

  • The jackknife estimated standard errors are often close to the delta method standard errors.

This jackknife, however, has some limitations (cons). The main limitations are:

  • It can be computationally burdensome for very large samples (e.g., if used with ultra high frequency data).

  • It does not work well for non-smooth functions such as empirical quantiles.

  • It is not well suited for computing confidence intervals.

  • It is not as accurate as the bootstrap.


  1. the scaling of the standard deviation of ˆμt is approximately T.↩︎

  2. A jackknife is also the name of a very useful folding knife.↩︎