Bootstrap confidence intervals
ci=ciboot(x,T) ci=ciboot(x,T,method) ci=ciboot(x,T,method,c) ci=ciboot(x,T,method,c,b) [ci,y]=ciboot(...)
a matrix of doubles
a function or a list, the function which computes the empirical estimate from x.
a 1-by-1 matrix of doubles, integer, the method to use. Available methods are 1,2,3,4,5,6 (default method=5). See below for details.
a 1-by-1 matrix of doubles, the confidence level (default c=0.9, which corresponds to a 90% confidence interval)
a 1-by-1 matrix of doubles, the number of bootstrap resamples (default b=200)
a m-by-3 matrix of doubles, the confidence interval for the parameter estimate. ci(:,1) is the lower bound, ci(:,2) is the estimate, ci(:,3) is the upper bound. Each row in ci represents a component of the parameter estimate.
a m-by-b matrix of doubles, the parameter estimates of the resamples
Compute a bootstrap confidence interval for T(x) with level c.
The function T must have the following header:
p=T(x)
x
is the sample or the resample
and p
is a m-by-1 matrix of doubles.
In the case where the parameter estimate has a more general
shape (e.g. 2-by-2), the shape of p
is reshaped
into a column vector with m
components.
See "T and extra arguments" for details on how to pass extra-arguments to T.
The available values of method
are the following.
method=1. Normal approximation (std is bootstrap).
method=2. Simple bootstrap principle (bad, don't use).
method=3. Studentized, std is computed via jackknife.
If T is the mean function, you may use the test1b
function, which is faster.
method=4. Studentized, std is 30 samples' bootstrap.
method=5. Efron's percentile method (default).
method=6. Efron's percentile method with bias correction (BC).
Often T(x) is a single number (e.g. the mean) but it may also be a vector or a even a matrix (e.g. the covariance matrix). Every row of the result ci is of the form
[LeftLimit, PointEstimate, RightLimit]
t = T(x); t = t(:);
// Estimate a 90% confidence interval for // the empirical standard deviation n = 20; x=distfun_chi2rnd(3,n,1); s=stdev(x) ci=ciboot(x,stdev) [ci,y] = ciboot(x,stdev,[],0.9,1000); size(y) x = distfun_unifrnd(0,1,13,2) // Estimate the covariance C = cov(x) // Estimate a 90% confidence interval ci = ciboot(x,cov) // Test all methods n = 20; x=distfun_chi2rnd(3,n,1); ci=ciboot(x,mean,1) ci=ciboot(x,mean,2) ci=ciboot(x,mean,3) ci=ciboot(x,mean,4) ci=ciboot(x,mean,5) ci=ciboot(x,mean,6) // With extra-arguments for T. x=distfun_chi2rnd(3,20,5); s=stdev(x,"r") ci=ciboot(x,list(stdev,"r")) | ![]() | ![]() |