View source: R/ctStanGenerateFromFit.R
ctStanGenerateFromFit | R Documentation |
$generated
object to ctstanfit object, with random data generated from posterior of ctstanfit objectAdd a $generated
object to ctstanfit object, with random data generated from posterior of ctstanfit object
ctStanGenerateFromFit(
fit,
nsamples = 200,
fullposterior = FALSE,
verboseErrors = FALSE,
cores = 2
)
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. |
Matrix of generated data – one dataset per iteration, according to original time and missingness structure.
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.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.