ctsem (version 3.3.11)

ctStanGenerate: Generate data from a ctstanmodel object

Description

Generate data from a ctstanmodel object

Usage

ctStanGenerate(
  ctm,
  datastruct,
  optimize = TRUE,
  is = FALSE,
  fullposterior = TRUE,
  nsamples = 200,
  parsonly = FALSE,
  includePreds = FALSE,
  ...
)

Arguments

ctm

ctStanModel object.

datastruct

long format data structure as used by ctsem.

optimize

Whether to optimize or use Stan's HMC sampler

is

If optimizing, follow up with importance sampling?

fullposterior

Generate from the full posterior or just the mean?

nsamples

How many samples to generate?

parsonly

If TRUE, only return samples of raw parameters, don't generate data.

includePreds

if TRUE, the prior for covariate effects (TD and TI predictors) is included, as well as the TD and TI pred data. Else the effects are set to zero.

...

arguments to pass to stanoptimis

Value

Array of nsamples x time points x manifest variables.

Examples

Run this code
# NOT RUN {
#generate and plot samples from prior predictive
priorpred <- ctStanGenerate(ctm = ctstantestfit$ctstanmodelbase,
  datastruct = ctstantestdat,cores=2,nsamples = 50)
# }

Run the code above in your browser using DataLab