Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

ctStanGenerateFromFit

Add a $generated object to ctstanfit object, with random data generated from posterior of ctstanfit object


Description

Add a $generated object to ctstanfit object, with random data generated from posterior of ctstanfit object

Usage

ctStanGenerateFromFit(
  fit,
  nsamples = 200,
  fullposterior = FALSE,
  verboseErrors = FALSE,
  cores = 2
)

Arguments

fit

ctstanfit object

nsamples

Positive integer specifying number of datasets to generate.

fullposterior

Logical indicating whether to sample from the full posterior (original nsamples) or the posterior mean.

verboseErrors

if TRUE, print verbose output when errors in generation encountered.

cores

Number of cpu cores to use.

Value

Matrix of generated data – one dataset per iteration, according to original time and missingness structure.

Examples

if(w32chk()){

gen <- ctStanGenerateFromFit(ctstantestfit, nsamples=3,fullposterior=TRUE,cores=1)
plot(gen$generated$Y[3,,2],type='l') #Third random data sample, 2nd manifest var, all time points. 
}

ctsem

Continuous Time Structural Equation Modelling

v3.4.3
GPL-3
Authors
Charles Driver [aut, cre, cph], Manuel Voelkle [aut, cph], Han Oud [aut, cph], Trustees of Columbia University [cph]
Initial release
2021-04-20

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.