ctStanGenerate {ctsem} | R Documentation |
Generate data from a ctstanmodel object
Description
Generate data from a ctstanmodel object
Usage
ctStanGenerate(
cts,
datastruct = NA,
is = FALSE,
fullposterior = TRUE,
nsamples = 200,
parsonly = FALSE,
cores = 2
)
Arguments
cts |
|
datastruct |
long format data structure as used by ctsem. Not used if cts is a ctStanFit object. |
is |
If optimizing, follow up with importance sampling? |
fullposterior |
Generate from the full posterior or just the (unconstrained) mean? |
nsamples |
How many samples to generate? |
parsonly |
If TRUE, only return samples of raw parameters, don't generate data. |
cores |
Number of cpu cores to use. |
Value
List contining Y, and array of nsamples by data rows by manifest variables, and llrow, an array of nsamples by data rows log likelihoods.
Examples
#generate and plot samples from prior predictive
priorpred <- ctStanGenerate(cts = ctstantestfit,cores=2,nsamples = 50)
[Package ctsem version 3.10.4 Index]