Bootstrap Confidence interval Error: "Statistic size 999 for one jackknife sample is not equal to statistic size for the entire data 1000"

4 views (last 30 days)
Afternoon
I am currently busy with a project that requires me to get the confidence interval of a number of runs of data that does not conform to any particular distribution (data is in aveBL.mat). To do this I have attempted to use the bootstrap function (shown in the code below and in BLexp.m. However I get the error: "Statistic size 999 for one jackknife sample is not equal to statistic size for the entire data 1000".
I am unsure of how to solve this problem. Assistance will be appreciated
Thank You in Advance
V
%Bootstrap Confidence Interval
clc
a = 128.9;
b = 180.4;
c = -8.258;
m = @(x) a*(1-exp(-x/b))+c
bootci(1000,m,aveBL(1:1000))

Answers (1)

Jeff Miller
Jeff Miller on 15 Oct 2019
The problem is that the output of function m is a vector of 1000 elements for the full sample and it is a vector of 999 elements for the jackknife sample (i.e., 1000 ~= 999).
Usually bootstrap ci's are computed in situations where the sample statistic (i.e., output of function m, in this case) is a single numerical value--not a vector. For example, there is no error if you write
m = @(x) sum(a*(1-exp(-x/b))+c)
It is difficult to say more than this without knowing exactly what function m you are trying to bootstrap.

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!