R/boot.R
pbmvn.Rd
Generates B
number of parametric bootstrap
samples using estimated parameters
from the original sample data
.
data
is referred to as the empirical distribution
with the following distributional assumption
$$
\hat{
F
}_{
\mathcal{
N
}_{k}
\left(
\boldsymbol{
\hat{
\mu
}
}
\left(
\boldsymbol{
\hat{
\theta
}
}
\right) ,
\boldsymbol{
\hat{
\Sigma
}
}
\left(
\boldsymbol{
\hat{
\theta
}
}
\right)
\right)
} .
%(\#eq:boot-pb-mvn)
$$
Bootstrap samples are generated from a multivariate normal distribution
using the fitted model-implied mean vector
and variance-covariance matrix.
pbmvn( n, muhatthetahat, Sigmahatthetahat, tol = 1e-06, empirical = FALSE, B = 2000L, par = FALSE, ncores = NULL, mc = TRUE, lb = FALSE, cl_eval = FALSE, cl_export = FALSE, cl_expr, cl_vars )
n | Integer. Sample size. |
---|---|
muhatthetahat | Vector. Mean vector as a function of estimated parameters or the fitted model-implied mean vector \( \boldsymbol{ \hat{ \mu } } \left( \boldsymbol{ \hat{ \theta } } \right) %(\#eq:boot-pb-mvn-mu) \) . |
Sigmahatthetahat | Matrix. Variance-covariance matrix as a function of estimated parameters or the fitted model-implied variance-covariance matrix \( \boldsymbol{ \hat{ \Sigma } } \left( \boldsymbol{ \hat{ \theta } } \right) %(\#eq:boot-pb-mvn-Sigma) \) . |
tol | Numeric.
Tolerance (relative to largest variance)
for numerical lack of positive-definiteness in |
empirical | Logical.
If |
B | Integer. Number of bootstrap samples. |
par | Logical.
If |
ncores | Integer.
Number of cores to use if |
mc | Logical.
If |
lb | Logical.
If |
cl_eval | Logical.
Execute |
cl_export | Logical.
Execute |
cl_expr | Expression.
Expression passed to |
cl_vars | Character vector.
Names of objects to pass to |
Returns a list of length B
of parametric bootstrap samples.
For more details and examples see the following vignettes:
Efron, B., & Tibshirani, R. J. (1993). An introduction to the bootstrap. New York, N.Y: Chapman & Hall.
Wikipedia: Bootstrapping (statistics)
B <- 5L Sigmahatthetahat <- matrix( data = c( 82.37344, 70.55922, 17.83930, 70.55922, 112.57145, -75.98558, 17.83930, -75.98558, 338.46263 ), nrow = 3 ) muhatthetahat <- c( 108.3060, 105.3324, 103.4009 ) Xstar <- pbmvn( n = 5, Sigmahatthetahat = Sigmahatthetahat, muhatthetahat = muhatthetahat, B = B ) str(Xstar)#> List of 5 #> $ : num [1:5, 1:3] 96.6 94.9 119 125.5 95.8 ... #> ..- attr(*, "dimnames")=List of 2 #> .. ..$ : NULL #> .. ..$ : NULL #> $ : num [1:5, 1:3] 118 119 122 107 112 ... #> ..- attr(*, "dimnames")=List of 2 #> .. ..$ : NULL #> .. ..$ : NULL #> $ : num [1:5, 1:3] 127 119 111 118 111 ... #> ..- attr(*, "dimnames")=List of 2 #> .. ..$ : NULL #> .. ..$ : NULL #> $ : num [1:5, 1:3] 101 108 123 125 110 ... #> ..- attr(*, "dimnames")=List of 2 #> .. ..$ : NULL #> .. ..$ : NULL #> $ : num [1:5, 1:3] 112 112 108 115 120 ... #> ..- attr(*, "dimnames")=List of 2 #> .. ..$ : NULL #> .. ..$ : NULL