Description Details Author(s) References See Also Examples
The package provides a computationally efficient and general algorithm to obtain iterated bootstrap tests and confidence sets based on the unstudentised version of the Rao statistic for a p-dimensional parameter. The outer and inner level of resampling required to obtain respectively the simple and the re-calibrated bootstrap critical values (at the null hypothesys) are performed in a weighted fashion. The particular choice of the resampling weights allows to obtain accurate re-calibrated critical values with one level of bootstrap iteration only (Lee and Young, 2003).
The algorithm is particularly efficient as it combines a deterministic stopping rule (Nankervis, 2005) and a computationally convenient statistic to bootstrap on (Lunardon, 2013).
Function Iboot
is merely an R wrapper to call a set of foreign functions all written in C language so that computational efficiency is increased. Some C routines are borrowed from R sources: numerical optimisation and sorting relies on lbfgsb
and revsort
located in "/src/main/optim.c" and "/src/main/sort.c", respectively. The function ProbSampleReplace
for sampling with unequal probabilities has been slightly modified to cut down the number of unnecessary operations for bootstrap resamplings.
Nicola Lunardon <nicola.lunardon@econ.units.it>.
Maintainer: Nicola Lunardon <nicola.lunardon@econ.units.it>.
Lee, S., Young, A. (2003). Prepivoting by weighted bootstrap iteration. Biometrika, 90, 393–410.
Lunardon, N. (2013). Prepivoting composite score statistics by weighted bootstrap iteration. E-print: arXiv/1301.7026.
Nankervis, J. (2005). Computational algorithms for double bootstrap confidence intervals. Computational statistics & data analysis, 45, 461–475.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | ####Example 1: mean of a normal with known scale
n <- 20
mu <- 1
set.seed(1)
##contributions obtained from the score function
gr <- rnorm(n, mu) - mu
OBJ.Ib <- Iboot(gradient=gr, B=500, M=500, kB=0.01, alpha=c(0.1, 0.05, 0.01), seed=1)
##critical values for testing H0: mu=1, H1: mu!=1
OBJ.Ib
summary(OBJ.Ib)
####Example 2: variance of a normal with known location
n <- 20
mu <- 1
sig2 <- 1
set.seed(1)
##contributions obtained from the score function
gr <- ( rnorm(n, mu, sqrt(sig2)) - mu )^2/sig2 - 1
OBJ.Ib <- Iboot(gradient=gr, B=500, M=500, kB=0.01, alpha=c(0.1, 0.05, 0.01), seed=3)
##critical values for testing H0: sig2=1, H1: sig2!=1
OBJ.Ib
summary(OBJ.Ib)
|
Loaded Iboot 0.1-1
Observed value: 0.726
Bootstrap quantile(s):
90% 95% 99%
2.758 3.975 6.322
Re-calibrated bootstrap quantile(s):
93.4% 98% 99.8%
3.445 5.382 8.350
Algorithm ended succesfully.
Actual proportion of convex hull condition failures: 0
Call:
Iboot(gradient = gr, B = 500, M = 500, kB = 0.01, alpha = c(0.1,
0.05, 0.01), seed = 1)
Bootstrap distribution:
Min. 1st Qu. Median Mean 3rd Qu. Max.
0.000 0.122 0.484 1.026 1.401 9.572
Observed value: 0.726
Bootstrap quantile(s):
90% 95% 99%
2.758 3.975 6.322
Re-calibrated bootstrap quantile(s):
93.4% 98% 99.8%
3.445 5.382 8.350
Algorithm ended succesfully.
Actual proportion of convex hull condition failures: 0
Observed value: 0.5874
Bootstrap quantile(s):
90% 95% 99%
4.531 6.862 12.725
Re-calibrated bootstrap quantile(s):
93.6% 98.2% 99.8%
6.012 10.651 20.332
Algorithm ended succesfully.
Actual proportion of convex hull condition failures: 0.006
Call:
Iboot(gradient = gr, B = 500, M = 500, kB = 0.01, alpha = c(0.1,
0.05, 0.01), seed = 3)
Bootstrap distribution:
Min. 1st Qu. Median Mean 3rd Qu. Max.
0.000 0.223 0.809 1.794 2.165 20.484
Observed value: 0.5874
Bootstrap quantile(s):
90% 95% 99%
4.531 6.862 12.725
Re-calibrated bootstrap quantile(s):
93.6% 98.2% 99.8%
6.012 10.651 20.332
Algorithm ended succesfully.
Actual proportion of convex hull condition failures: 0.006
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.