Next: Cross Validation Up: Lectures Previous: More about the theoretical

Subsections

# The jackknife

A little history, the first idea related to the bootstrap was Von-Mises, who used the plug-in principle in the 1930's. Then in the late 50's Quenouille found a way of correcting the bias for estimators whose bias was known to be of the form:

Even if the numerators are unkowns depending on the real distribution .

This method was the jackknife.

This is the first time that the sample was manipulated, each observation is dropped once from the sample, when the observation has been dropped, we call the estimator and their average is

We can use the jackknife for estimating the bias by:

We showed in class that if the bias is of the order as in then the Jackknife estimate is in

We can show that if the bias is of the order as in then the Jackknife estimate is in

So the order of the bias has been decreased from to Example:
Suppose for which the plug in estimate is:

### Example: Patch Data

We are interested in the parameter

Jackknifeold placebo, new old.
MATLAB Note
 FEVAL Execute function specified by string.
If F is a string containing the name of a function (usually
defined by an M-file), then  FEVAL(F,x1,...,xn)  evaluates
that function at the given arguments.
For example, F = 'foo', FEVAL(F,9.64) is the same as foo(9.64).
FEVAL is usually used inside functions which have the names of
other functions as arguments.  Examples include FZERO and EZPLOT.
[y1,..,yn] = FEVAL(F,x1,...,xn) returns multiple output arguments.
Within methods that overload built-in functions, use
BUILTIN(FUN,...) to execute the original built-in function.


%------------------------------------------
function out=jackbias(theta,orig)
%Estimate the bias using the jackknife
%Theta has to be a character string containg
% a valid function name
[n,p]=size(orig);
lot=feval(theta,orig(2:n,:));
k=length(lot);
lo=zeros(n,k);
lo(1,:)=lot;
lo(n,:)=feval(theta,orig(1:(n-1),:));
for i=(2:(n-1))
lo(i,:)=feval(theta,orig([1:(i-1),(i+1):n],:));
end
%-------------------------------
function out=ratio(yszs)
%Computes the ratio of mean of first
%column of mean of second column
out=mean(yszs(:,1))/mean(yszs(:,2));
%-------------------------------------
>>z=oldpatch-placebo ; y=newpatch-oldpatch
>> yz=[y,z]
-1200        8406
2601        2342
-2705        8187
1982        8459
-1290        4795
351        3516
-638        4796
-2719       10238
>>ratio(yz)
-0.0713
>> jackbias('ratio',yz)
ans =    0.0080


Bootstrap Simulations

function out=bootbias(theta,orig,B)
thetabs=zeros(1,B);
for b=(1:B)
bs=bsample(orig);
thetabs(b)=feval(theta,bs);
end
theta0=feval(theta,orig);
out=mean(thetabs)-theta0;
%-----------------------------------
>> bootbias('ratio',yz,1000)
ans =    0.0085
%-----------------------------------
function out=bootmultin(orig,B)
[n,p]=size(orig);
out=zeros(B,n);
for b=1:B
inds=randint(1,n,n)+1;
for i=1:n
out(b,inds(i))=out(b,inds(i))+1;
end;
end
%-----------------------------------
>> bootmultin(law15,5)
1  1  2  0  1  1  0   1   3  0  2  2  1  0  0
3  1  0  1  2  2  0   1   2  2  0  0  0  0  1
0  0  0  3  0  4  3   0   2  0  1  0  0  1  1
1  1  2  2  0  1  1   0   2  1  1  1  0  0  2
2  0  0  2  2  0  0   0   0  1  3  3  0  2  0


Next: Cross Validation Up: Lectures Previous: More about the theoretical
Susan Holmes 2004-05-19