The Jackknife and Bootstrap

目录

3 Methods: the jackknife and bootstrap

A statistic θ^\hat{\theta} that we are interested in is a function of the sample XX:

θ^=s(X).(12)\hat{\theta} = s(X). \tag{12}

Bootstrap is designed to get the standard deviation of θ^\hat{\theta} using new samples generated from the original sample XX. To understand bootstrap, we can start with jackknife first.

3.1 The jackknife estimate of standard error

The basic idea of jackknife is to create new samples from the observed sample using the method of removing one observation at a time.

Define the ii^th^ jackknife sample as the remaining sample after dropping the iith sample, that is

X(i)=(Xi,X2,...,Xi1,Xi+1,...,Xn),      for i=1,2,...,n.(13)X_{(i)} = (X_i, X_2, ..., X_{i-1},X_{i+1}, ...,X_n)', ~~~~~~ \text{for} ~ i = 1, 2, ..., n. \tag{13}

The corresponding value of the statistic of interest can be obtained from these jackknife samples as

θ^(i)=s(X(i)),      for i=1,2,...,n.(14)\hat{\theta}_{(i)} = s(X_{(i)}), ~~~~~~ \text{for} ~ i = 1, 2, ..., n. \tag{14}

From these nn new statistics, the jackknife estimate of standard error for θ^\hat{\theta} can be calculated as

se^jack=n1n1n(θ^(i)i=1nθ^(i)n)2.(15)\hat{se}_{jack} = \sqrt {\frac{n-1}{n} \sum_1^n \left( \hat{\theta}_{(i)} - \frac{\sum_{i = 1}^n \hat{\theta}_{(i)}}{n} \right)^2}. \tag{15}

Take the sample mean Xˉ\bar{X} as an example. To get the jackknife estimate of standard error for Xˉ\bar{X}, we calculate the sample means of nn jackknife samples

Xˉ(i)=X1+X2+...+Xi1+Xi+1+...+Xnn1,        for i=1,2,...,n.(16)\bar{X}_{(i)} = \frac{X_1 + X_2 + ... + X_{i-1} + X_{i+1} + ... + X_n}{n-1}, ~~~~~~~~ \text{for} ~ i = 1, 2, ..., n. \tag{16}

Then the jackknife estimate of standard error for Xˉ\bar{X} is

se^jack=n1ni=1n(Xˉ(i)i=1nXˉ(i)n)2.(17)\hat{se}_{jack} = \sqrt {\frac{n-1}{n} \sum_{i = 1}^n \left( \bar{X}_{(i)} - \frac{\sum_{i = 1}^n \bar{X}_{(i)}}{n} \right)^2}. \tag{17}

Substitute equation (16)(16) into equation (17)(17) and use Xˉ\bar{X} to denote the original sample mean, we get

se^jack=i=1n(XiXˉ)2n(n1),(18)\hat{se}_{jack} = \sqrt {\frac{\sum_{i = 1}^n(X_i - \bar X)^2}{n(n-1)}}, \tag{18}

which is exactly the same form as the classic formula.

3.2 The nonparametric bootstrap estimate of standard error

The jackknife approach does not work for unsmooth statistics while bootstrap does not have these drawbacks. More details about the features of jackknife and bootstrap can be found in Efron and Hastie’s (2016) book. The difference between bootstrap samples from jackknife samples is that bootstrap samples are obtained from random sampling with replacement. Apart from this, instead of nn new samples, there can be any number of bootstrap samples. Though 200 bootstrap samples would be sufficient for the estimate of standard error (Efron and Tibshirani, 1993). The sample size of a bootstrap sample is nn, the same as the original sample.

Let the number of bootstrap samples be BB. Then denote the ii^th^ bootstrap sample as

X(i)=(X1,X2,...,Xn),      for i=1,2,...,B.(19)X^*_{(i)} = (X^*_1, X^*_2, ..., X^*_n), ~~~~~~ \text{for} ~ i = 1, 2, ..., B. \tag{19}

Similarly, the corresponding value of the statistic of interest can be obtained as

θ^(i)=s(X(i)),      for i=1,2,...,B.(20)\hat{\theta}^*_{(i)} = s(X_{(i)}^*), ~~~~~~ \text{for} ~ i = 1, 2, ..., B. \tag{20}

The bootstrap estimate of standard error for θ^\hat{\theta} is then the empirical standard deviation of these BB values,

se^boot=1B(θ^(i)1Nθ^(i)B)2B1.(21)\hat{se}_{boot} = \sqrt{\frac{\sum_1^B \left( \hat{\theta}^*_{(i)} - \frac{\sum_1^N \hat{\theta}^*_{(i)}}{B} \right)^2}{B-1}}. \tag{21}

Take a dataset of 500 uncorrelated data from the standard normal distribution as an example.

As shown in Figure 2,

  • Randomly obtain 500 data with replacement from the dataset as Sample 1.

  • Then repeat this procedure BB times (B=200B = 200 is used in this example) to get Sample 2, Sample 3, …

  • Calculate the corresponding statistics of interest of these samples. The sample mean is used in this example.

  • Bootstrap estimate of standard error for this statistic then can be calculated.

Boot_Gaussian_Distr

Figure 2: The process of Bootstrap applied for example data set

3.3 Resampling Plans

The jackknife and the bootstrap are both specific situations of resampling from the original sample X=(X1,X2,...,Xn)X = (X_1, X_2, ..., X_n)'.

3.3.1 Resampling Vector

Define a resampling vector P=(P1,P2,...,Pn)\mathbf{P} = (P_1, P_2, ..., P_n), in which Pi0P_i \geq 0 and i=1nPi=1\sum_{i=1}^{n} P_i = 1.

PiP_i in the vector P\mathbf{P} means how much XiX_i weights in the new sample:

Pi=The number of Xi in the new sampleThe sample size of the new sample.(22)P_i = \frac{\text{The number of} ~ X_i ~ \text{in the new sample}}{\text{The sample size of the new sample}}. \tag{22}

Therefore, the information in the new sample can be obtained entirely from PP and the original sample vector X=(X1,X2,...,Xn)X = (X_1, X_2, ..., X_n)'.

The set of all possible values of PiP_i is a space which is a simplex 1 denoted by SnS_n.

The new sample can be totally obtained from resampling vector P\mathbf{P} with the original sample XX fixed. Thus, the statistic of interest θ^\hat{\theta}^* corresponding to this specific new sample can be written as a function of P\mathbf{P}:

θ^=S(P).(23)\hat{\theta}^* = S(\mathbf{P}). \tag{23}

The resampling plans intends to find out how the statistic of interest θ^\hat{\theta}^* changes with the weight vector P\mathbf{P} varies across its value space, namely SnS_n, holding the original data set XX fixed.

3.3.2 Resampling vectors of jackknife samples and bootstrap samples

Let the resampling vector with equal weight on each XiX_i be

P0=(1,1,...,1n in total)n.(24)\mathbf{P}_0 = \frac{(\overbrace{1, 1, ..., 1}^{n ~ in ~ total})'}{n}. \tag{24}

The sample corresponding to P0\mathbf{P}_0 is exactly the same as the original sample XX. Then we have

S(P0)=s(X)=θ^,(25)S(\mathbf{P}_0) = s(X) = \hat{\theta}, \tag{25}

which is the original estimate of the statistic of interest.

The resampling vector of the ii^th^ jackknife sample X(i)X_{(i)} is

P(i)=(1,1,...,1i1,0,1,1,...,1ni)n1.(26)\mathbf{P}_{(i)} = \frac{(\overbrace{1, 1, ..., 1}^{i-1}, 0, \overbrace{1, 1, ..., 1}^{n-i})'}{n-1}. \tag{26}

For the ii^th^ bootstrap sample X(i)X^*_{(i)}, the resampling vector is

P(i)=(N1,N2,...,Nn)n,(27)\mathbf{P}^*_{(i)} = \frac{(N_1, N_2, ..., N_n)'}{n}, \tag{27}

where NiN_i denotes the number of XiX_i (the ii^th^ observation from the original sample) in the new sample. Therefore we will have 1nNi=n\sum_1^n N_i = n.

What we do to get a bootstrap sample is to draw nn times from nn observations, and the probability of each observation being drawn is 1/n. Thus the outcome (N1,N2,...,Nn)(N_1, N_2, ..., N_n)' follows a multinomial distribution. Therefore, for each specific value of P(i)\mathbf{P}^*_{(i)}, the probability of getting its corresponding sample denoted bootstrap probability can be calculated.

3.3.3 An Example of Resampling Simplex for Sample of Size 3

Figure 3 demonstrates a resampling simplex for the original sample with 33 observations X=(X1,X2,X3)X = (X_1, X_2, X_3)'.

The centre point is P0\mathbf{P}_0 with the same weight for these 33 observations. P(1)\mathbf{P}_{(1)}, P(2)\mathbf{P}_{(2)} and P(3)\mathbf{P}_{(3)} are the jackknife points. For each jackknife point, the one observation removed has weight 0 while the remaining two both weigh 1/21/2.

As for bootstrap, there are 10 possible situations for its new samples which are P0\mathbf{P}_0, the three corner points and the six red starred points. The probability of obtaining these samples is different. Ideally, in every 2727 samples, there will be 66 centre points (P0\mathbf{P}_0), 11 for each of the 33 corner points and 33 for each of the 66 red starred points.

simplex

Figure 3: An example of a resampling simplex for sample size n = 3

3.3.4 The statistic of interest corresponding to the resampling vector

To explore the relationship between the statistic of interest θ^\hat{\theta}^* and the resampling vector P\mathbf{P} is to study the features of the function between them which is θ^=S(P)\hat{\theta}^* = S(\mathbf{P}).

The Euclidean distance between a jackknife vector P(i)\mathbf{P}_{(i)} and P0\mathbf{P}_0 is

P(i)P0=1n(n1).(28)\| \mathbf{P}_{(i)} - \mathbf{P}_{0} \| = \frac{1}{\sqrt{n(n-1)}}. \tag{28}

With bootstrap probability known, the expected root mean square distance between a bootstrap vector P(i)\mathbf{P}^*_{(i)} and P0\mathbf{P}_0 can be calculated as well:

(EP(i)P02)12=n1n2.(29){\left( E {\| \mathbf{P}^*_{(i)} - \mathbf{P}_{0}} \|^2 \right)}^{\frac{1}{2}} = \sqrt{\frac{n-1}{n^2}}. \tag{29}

From above we can get that the expected distance between a bootstrap vector and the centre is an order of magnitude n\sqrt{n} times further than the centre distance of a jackknife vector.

The approximate directional derivative of S(P)S(\mathbf{P}) in the direction from P(i)\mathbf{P}_{(i)} to P0\mathbf{P}_0 is

Di=S(P(i))S(P0)P(i)P0=(θ^(i)1nθ^(i)n)(n(n1)),(30)D_i = \frac{ S(\mathbf{P}_{(i)}) - S({\mathbf{P}_{0})} }{\| \mathbf{P}_{(i)} - \mathbf{P}_{0} \|} = \left( \hat{\theta}_{(i)} - \frac{\sum_1^n \hat{\theta}_{(i)}}{n} \right) \left( \sqrt{n(n-1)} \right), \tag{30}

which means the slope of function S(P)S(\mathbf{P}) at P0\mathbf{P}_0 in the direction of P(i)\mathbf{P}_{(i)}.

Compare it with the formula of the jackknife estimate of standard error for θ^\hat{\theta} (se^jack\hat{se}_{jack}), we can find that se^jack\hat{se}_{jack} is proportional to the root mean square of the slopes DiD_i.

When S(P)S(\mathbf{P}) is a linear function of P\mathbf{P}, like the sample mean, se^jack\hat{se}_{jack} is equal to se^boot\hat{se}_{boot}. And when S(P)S(\mathbf{P}) is not linear, se^jack\hat{se}_{jack} is only an approximation (Efron and Hastie, 2016).

3.3.5 Compromise of the bootstrap algorithm

Theoretically, for a specific original sample set, with the distribution of all the possible bootstrap vectors known, the ideal bootstrap standard error estimate can be evaluated.

For a sample set with KK possible resampling points, the ideal bootstrap standard error estimate is

se^boot=i=1Kpk(S(P(k))S(P0))2,(31)\hat{se}_{boot} = \sqrt{ \sum_{i = 1}^K p_k \left( S(\mathbf{P}_{(k)}^*) - S(\mathbf{P}_{0}) \right)^2 }, \tag{31}

where pkp_k is the bootstrap probability corresponding to P(k)\mathbf{P}_{(k)}^*. In this situation, the weighted mean of these KK resampling points is the same as S(P0)S(\mathbf{P}_{0}).

However, the number of the possible resampling points KK increase incredibly with the increase of the sample size nn. For a sample of size n

K=(2n1n).(32)K = \begin{pmatrix} 2n-1 \\\\ n \end{pmatrix}. \tag{32}

For n=20n = 20, the number of KK comes to 6.9×10106.9 \times 10^{10} already. Thus it is unrealistic to calculate the ideal bootstrap standard error estimate in real life. What we do is to choose BB resampling vectors at random, as mentioned in the former part, to get a sufficiently accurate estimate.

References

Efron, B., Hastie, T. (2016) The Jackknife and the Bootstrap, Computer age statistical inference Algorithms, evidence, and data science. Cambridge: Cambridge University Press, pp. 155-166.

Footnotes

  1. A (n1)(n - 1)-dimensional simplex (SnS_n) is a set of nonnegative vectors summing to 1. More details of simplex can be found in Weisstein, E. W. “Simplex.” Accessed March 22^th^ 2021. MathWorld—A Wolfram Web Resource. https://mathworld.wolfram.com/Simplex.html.

← 返回文章列表