<< T and extra arguments Resampling covboot >>

Stixbox >> Stixbox > Resampling > ciboot

ciboot

Bootstrap confidence intervals

Calling Sequence

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(...)

Parameters

x :

a matrix of doubles

T :

a function or a list, the function which computes the empirical estimate from x.

method :

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.

c :

a 1-by-1 matrix of doubles, the confidence level (default c=0.9, which corresponds to a 90% confidence interval)

b :

a 1-by-1 matrix of doubles, the number of bootstrap resamples (default b=200)

ci :

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.

y :

a m-by-b matrix of doubles, the parameter estimates of the resamples

Description

Compute a bootstrap confidence interval for T(x) with level c.

The function T must have the following header:

p=T(x)
where 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.

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]
and the corresponding element of T(x) is found by noting that
t = T(x);
t = t(:);
is used in the routine.

Examples

// 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"))

See also

Authors


Report an issue
<< T and extra arguments Resampling covboot >>