predict.emc {EMC2}R Documentation

Generate posterior predictives

Description

Simulate n_post data sets using the posterior parameter estimates

Usage

## S3 method for class 'emc'
predict(
  object,
  hyper = FALSE,
  n_post = 100,
  n_cores = 1,
  stat = c("random", "mean", "median")[1],
  ...
)

Arguments

object

An emc object from which posterior predictives should be generated

hyper

Boolean. Defaults to FALSE. If TRUE, simulates from the group-level (hyper) parameters instead of the subject-level parameters.

n_post

Integer. Number of generated datasets

n_cores

Integer. Number of cores across which there should be parallellized

stat

Character. Can be mean, median or random (i.e., the default). Will take either random samples from the chain(s) or use the mean or median of the parameter estimates.

...

Optional additional arguments passed to get_pars or make_data

Value

A list of simulated data sets of length n_post

Examples


# based on an emc object ran by fit() we can generate posterior predictives
predict(samples_LNR, n_cores = 1, n_post = 10)


[Package EMC2 version 2.1.0 Index]