pbooter {distillery} | R Documentation |
Parametric Bootstrap Resampling
Description
Creates sample statistics for several replicated samples derived by sampling from a parametric distribution.
Usage
pbooter(x, statistic, B, rmodel, rsize, v.terms, verbose = FALSE, ...)
Arguments
x |
Original data set. If it is a vector, then it is assumed to be univariate. If it is a matrix, it is assumed to be multivariate where each column is a variate. |
statistic |
Function that minimally takes arguments: |
B |
number of bootstrap resamples to make. |
rmodel |
Function that generates the data to be applied to statistic. Must have arguments |
rsize |
Number giving the resample size for each bootstrap sample. If missing and |
v.terms |
If |
verbose |
logical, should progress information be printed to the screen? |
... |
Optional arguments to |
Details
Similar functionality to boot
from boot when sim
= “parametric”. In this case, the function is a little simpler, and is intended for use with ci.booted
, or just ci
. It is similar to booter
, but uses parametric sampling instead of resampling from the original data.
Value
A list object of class “booted” is returned with components:
call |
the function call |
data |
original data series |
statistic |
statistic argument passed in |
statistic.args |
all other arguments passed by ... |
B |
Number of bootstrap replicate samples |
v.terms |
if variance terms are returned by statistic, the argument is repeated in the returned object. |
rsize |
the size of the bootstrap resamples. |
rdata |
rsize by B matrix giving the rmodel generated data. |
v |
B length vector or B column matrix (if statistic returns a vector) giving the estimated parameter variances for each bootstrap replicate. |
orig.v |
vector giving the parameter variances (i.e. se^2) of statistic when applied to the original data. |
original.est |
vector giving the estimated parameter values when statistic is applied to the original data. |
results |
B length vector or B column matrix giving the parameter estimates for each bootstrap resample. |
type |
character stating whether the resample method is iid or cbb. |
Author(s)
Eric Gilleland
References
Efron, B. and Tibshirani, R. J. (1998) An Introduction to the Bootstrap. Chapman \& Hall, Boca Raton, Florida, 436 pp.
See Also
Examples
z <- rnorm( 100 )
zfun <- function( data, ... ) {
return( c( mean( data ), var( data ), mean( data^2 ), var( data^2 ) ) )
} # end of 'zfun' function.
rfun <- function( size, ... ) rnorm( size, ... )
res <- pbooter( x = z, statistic = zfun, rmodel = rfun, B = 500,
rsize = 100, v.terms = c(2, 4) )
print( res )
## Not run: ci( res )