ctsem (version 3.3.11)

stan_postcalc: Compute functions of matrices from samples of a stanfit object

Description

Compute functions of matrices from samples of a stanfit object

Usage

stan_postcalc(
  stanfit,
  object,
  calc = "object",
  objectindices = "all",
  summary = TRUE
)

Arguments

stanfit

object of class stanfit.

object

name of stan sub object from stanfit to use for calculations.

calc

string containing R calculation to evaluate, with the string 'object' in place of the actual object name.

objectindices

matrix of indices, with the number of columns matching the number of dimensions of the object. 'all' computes which( array(1,objdims)==1,arr.ind=TRUE), where objdims is what would be returned by dim(object) if the object existed in the R environment.

summary

if FALSE, a iterations * parameters matrix is returned, if TRUE, rstan::monitor is first run on the output.

Value

matrix of values of the specified interactions at each iteration.