Geoscience Reference
In-Depth Information
clear
agedepth = load('agedepth_1.txt');
meters = agedepth(:,1);
age = agedepth(:,2);
p = polyfit(meters,age,1);
for i = 1 : 30
j_meters = meters;
j_age = age;
j_meters(i) = [];
j_age(i) = [];
p(i,:) = polyfit(j_meters,j_age,1);
end
h e jackknife for subsamples with n -1=29 data points can be obtained by
a simple for loop. h e i th data point within each iteration is deleted and
regression coei cients are calculated for the remaining data points. h emean
of the i subsamples gives an improved estimate of the regression coei cients.
As with the bootstrap result, the slope of the regression line (i rst coei cient)
is well dei ned, whereas the intercept with the y -axis (second coei cient) has
a large uncertainty:
median(p(:,1))
ans =
5.3663
compared to 5.3855 calculated by the bootstrap method and
median(p(:,2))
ans =
21.7964
compared to 21.5374 from the bootstrap method (Section 4.5). h e true
values, as before, are 5.6 and 20. h e histograms of the jackknife results from
30 subsamples (Fig. 4.7)
subplot(1,2,1), histogram(p(:,1)), axis square
subplot(1,2,2), histogram(p(:,2)), axis square
do not display such clear distributions for the coei cients as the histograms
of the bootstrap estimates. As an alternative to the above method, MATLAB
provides the function jackknife with which to perform a jackknife
experiment.
p = jackknife('polyfit',meters,age,1);
Search WWH ::




Custom Search