View source: R/bootstrap_compute_ci.R
bootstrap_compute_ci | R Documentation |
Workhorse function for computing a confidence interval from a set of bootstrap samples.
bootstrap_compute_ci(
bootobj,
level,
type = c("percentile", "BC", "bootstrap-t")
)
bootobj |
matrix containing the bootstrap estimates of the parameters returned by a bootstrap workhorse function:
There should be one row for each parameter and each column contains a bootstrap estimate. |
level |
scalar between 0 and 1 indicating the confidence level. |
type |
string defining the type of confidence interval to construct. If
|
The percentile interval is constructed by taking the empirical
100\alpha
and 100(1-\alpha)
percentiles from the bootstrap
values. If \hat{F}
is the empirical distribution function of the
bootstrap values, then the 100(1 - 2\alpha)
given by
(\hat{F}^{-1}(\alpha), \hat{F}^{-1}(1-\alpha))
The bias-corrected (BC) interval corrects for median-bias. It is given by
(\hat{F}^{-1}(\alpha_1), \hat{F}^{-1}(1-\alpha_2))
where
\alpha_1 = \Phi{2\hat{z}_0 + \Phi^{-1}(\alpha)}
\alpha_2 = 1 - \Phi{2\hat{z}_0 + \Phi^{-1}(1-\alpha)}
\hat{z}_0 = \Phi^{-1}(\hat{F}(\hat{\beta}))
where \hat{\beta}
is the estimate from the original sample.
The bootstrap-t interval is based on the bootstrap distribution of
t^{b} = \frac{\hat{\beta}^{b} -
\hat{\beta}}{\hat{\sigma}^{b}}
where \hat{\sigma}
is the estimate of the standard error of
\hat{\beta}
and the superscript b denotes a bootstrap sample. Let
\hat{G}
be the empirical distribution function of the bootstrap
standardized statistics given above. Then, the bootstrap-t interval is given
by
(\hat{\beta} - \hat{\sigma}\hat{G}^{-1}(1-\alpha),
\hat{\beta} - \hat{\sigma}\hat{G}^{-1}\alpha)
matrix with the same number of rows as rows in bootobj
and
2 columns. The first column gives the lower limit of the confidence interval
the second column gives the upper limit of the confidence interval.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.