ctsem (version 3.9.1)

ctStanGenerate: 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
)

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.

Arguments

cts

ctStanModel , or ctStanFit,object.

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.

Examples

Run this code
# \donttest{
#generate and plot samples from prior predictive
priorpred <- ctStanGenerate(cts = ctstantestfit,cores=2,nsamples = 50)
# }

Run the code above in your browser using DataLab