pbmvn: Parametric Bootstrap (Multivariate Normal) from \boldsymbol{...

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/boot.R

Description

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} ≤ft( \boldsymbol{ \hat{ μ } } ≤ft( \boldsymbol{ \hat{ θ } } \right) , \boldsymbol{ \hat{ Σ } } ≤ft( \boldsymbol{ \hat{ θ } } \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.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
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
)

Arguments

n

Integer. Sample size.

muhatthetahat

Vector. Mean vector as a function of estimated parameters or the fitted model-implied mean vector \boldsymbol{ \hat{ μ } } ≤ft( \boldsymbol{ \hat{ θ } } \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{ Σ } } ≤ft( \boldsymbol{ \hat{ θ } } \right) %(\#eq:boot-pb-mvn-Sigma) .

tol

Numeric. Tolerance (relative to largest variance) for numerical lack of positive-definiteness in Sigma.

empirical

Logical. If TRUE, mu and Sigma specify the empirical not population mean and covariance matrix.

B

Integer. Number of bootstrap samples.

par

Logical. If TRUE, use multiple cores. If FALSE, use lapply().

ncores

Integer. Number of cores to use if par = TRUE. If unspecified, defaults to detectCores() - 1.

mc

Logical. If TRUE, use parallel::mclapply(). If FALSE, use parallel::parLapply() or parallel::parLapplyLB(). Ignored if par = FALSE.

lb

Logical. If TRUE use parallel::parLapplyLB(). If FALSE, use parallel::parLapply(). Ignored if par = FALSE and mc = TRUE.

cl_eval

Logical. Execute parallel::clusterEvalQ() using cl_expr. Ignored if mc = TRUE.

cl_export

Logical. Execute parallel::clusterExport() using cl_vars. Ignored if mc = TRUE.

cl_expr

Expression. Expression passed to parallel::clusterEvalQ() Ignored if mc = TRUE.

cl_vars

Character vector. Names of objects to pass to parallel::clusterExport() Ignored if mc = TRUE.

Details

For more details and examples see the following vignettes:

Notes: Intro to NB

Notes: Intro to PB

Value

Returns a list of length B of parametric bootstrap samples.

Author(s)

Ivan Jacob Agaloos Pesigan

References

Efron, B., & Tibshirani, R. J. (1993). An introduction to the bootstrap. New York, N.Y: Chapman & Hall.

Wikipedia: Bootstrapping (statistics)

See Also

Other bootstrap functions: nb(), pbuniv()

Examples

 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
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)

jeksterslabds/jeksterslabRboot documentation built on July 20, 2020, 12:56 p.m.