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

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
)

Arguments

cts

ctStanModel , or ctStanFit,object.

datastruct

long format data structure as used by ctsem. Not used if ctm 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)

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.