Imp.Estimates.Rd
Central moment, tail probability, and quantile estimates for a statistic under importance resampling.
imp.moments(boot.out = NULL, index = 1, t = boot.out$t[, index], w = NULL, def = TRUE, q = NULL) imp.prob(boot.out = NULL, index = 1, t0 = boot.out$t0[index], t = boot.out$t[, index], w = NULL, def = TRUE, q = NULL) imp.quantile(boot.out = NULL, alpha = NULL, index = 1, t = boot.out$t[, index], w = NULL, def = TRUE, q = NULL)
boot.out | A object of class |
---|---|
alpha | The alpha levels for the required quantiles. The default is to calculate the 1%, 2.5%, 5%, 10%, 90%, 95%, 97.5% and 99% quantiles. |
index | The index of the variable of interest in the output of
|
t0 | The values at which tail probability estimates are required. For
each value |
t | The bootstrap replicates of a statistic. By default these are taken
from the bootstrap output object |
w | The importance resampling weights for the bootstrap replicates. If they are
not supplied then |
def | A logical value indicating whether a defensive mixture is to be used
for weight calculation. This is used only if |
q | A vector of probabilities specifying the resampling distribution
from which any estimates should be found. In general this would
correspond to the usual bootstrap resampling distribution which
gives equal weight to each of the original observations. The
estimates depend on this distribution only through the importance
weights |
A list with the following components :
The alpha
levels used for the quantiles, if
imp.quantile
is used.
The values at which the tail probabilities are estimated, if
imp.prob
is used.
The raw importance resampling estimates. For imp.moments
this has length 2, the first component being the estimate of the
mean and the second being the variance estimate. For
imp.prob
, raw
is of the same length as t0
, and
for imp.quantile
it is of the same length as alpha
.
The ratio importance resampling estimates. In this method the
weights w
are rescaled to have average value one before they
are used. The format of this vector is the same as raw
.
The regression importance resampling estimates. In this method the weights
which are used are derived from a regression of t*w
on
w
. This choice of weights can be shown to minimize the
variance of the weights and also the Euclidean distance of the
weights from the uniform weights. The format of this vector is the
same as raw
.
Davison, A. C. and Hinkley, D. V. (1997) Bootstrap Methods and Their Application. Cambridge University Press.
Hesterberg, T. (1995) Weighted average importance sampling and defensive mixture distributions. Technometrics, 37, 185--194.
Johns, M.V. (1988) Importance sampling for bootstrap confidence intervals. Journal of the American Statistical Association, 83, 709--714.
# Example 9.8 of Davison and Hinkley (1997) requires tilting the # resampling distribution of the studentized statistic to be centred # at the observed value of the test statistic, 1.84. In this example # we show how certain estimates can be found using resamples taken from # the tilted distribution. grav1 <- gravity[as.numeric(gravity[,2]) >= 7, ] grav.fun <- function(dat, w, orig) { strata <- tapply(dat[, 2], as.numeric(dat[, 2])) d <- dat[, 1] ns <- tabulate(strata) w <- w/tapply(w, strata, sum)[strata] mns <- as.vector(tapply(d * w, strata, sum)) # drop names mn2 <- tapply(d * d * w, strata, sum) s2hat <- sum((mn2 - mns^2)/ns) c(mns[2] - mns[1], s2hat, (mns[2] - mns[1] - orig)/sqrt(s2hat)) } grav.z0 <- grav.fun(grav1, rep(1, 26), 0) grav.L <- empinf(data = grav1, statistic = grav.fun, stype = "w", strata = grav1[,2], index = 3, orig = grav.z0[1]) grav.tilt <- exp.tilt(grav.L, grav.z0[3], strata = grav1[, 2]) grav.tilt.boot <- boot(grav1, grav.fun, R = 199, stype = "w", strata = grav1[, 2], weights = grav.tilt$p, orig = grav.z0[1]) # Since the weights are needed for all calculations, we shall calculate # them once only. grav.w <- imp.weights(grav.tilt.boot) grav.mom <- imp.moments(grav.tilt.boot, w = grav.w, index = 3) grav.p <- imp.prob(grav.tilt.boot, w = grav.w, index = 3, t0 = grav.z0[3]) unlist(grav.p)#> t0 raw rat reg #> 1.8401182 0.6654464 0.9622113 0.9759514grav.q <- imp.quantile(grav.tilt.boot, w = grav.w, index = 3, alpha = c(0.9, 0.95, 0.975, 0.99)) as.data.frame(grav.q)#> alpha raw rat reg #> 1 0.900 2.458883 1.430694 3.47954 #> 2 0.950 2.871551 1.750000 3.47954 #> 3 0.975 3.102947 1.985627 3.47954 #> 4 0.990 3.183003 2.300204 3.47954