Skip to contents

The function generates simulated datasets based on a fitted model and refits the model to each generated dataset using the dynr package.

Usage

BootPara(
  fit,
  path,
  prefix,
  taskid,
  B = 1000L,
  ncores = NULL,
  seed = NULL,
  clean = TRUE
)

Arguments

fit

R object. Output of the FitDynr(), FitMx(), IllustrationFitDynr(), or IllustrationFitMx(), functions.

path

Path to a directory to store bootstrap samples and estimates.

prefix

Character string. Prefix used for the file names for the bootstrap samples and estimates.

taskid

Positive integer. Task ID.

B

Positive integer. Number of bootstrap samples.

ncores

Positive integer. Number of cores to use.

seed

Integer. Random seed.

clean

Logical. If clean = TRUE, delete intermediate files generated by the function.

Examples

if (FALSE) { # \dontrun{
set.seed(42)
library(dynr)
sim <- GenData(taskid = 1)
data <- RandomMeasurement(sim)
fit <- FitDynr(data, taskid = 1)
BootPara(
  fit = fit,
  path = getwd(),
  prefix = "pb",
  taskid = 1,
  B = 1000L
)
} # }