stem_measure: Generate a list of objects governing the measurement process...

View source: R/stem_measure.R

stem_measureR Documentation

Generate a list of objects governing the measurement process for a stochastic epidemic model.

Description

Generate a list of objects governing the measurement process for a stochastic epidemic model.

Usage

stem_measure(emissions, dynamics, data = NULL, messages = FALSE)

Arguments

emissions

list of emmision lists, each generated by a call to the emission function.

dynamics

processed list of objects governing the model dynamics, returned by the stem_dynamics function.

data

matrix/data frame, or a list of matrices/data frames. All columns must be named according to which compartment_strata are measured. The first column must consist of observation times, t_1,...,t_L. If data on all measured compartments are accrued at the same observation times, a single matrix or data frame may be provided. If each compartment in the data was measured at different observation times, a list of matrices or data frames must be provided. Again, the first column of each matrix must consist of observation times, while subsequent columns must be labeled according to which compartment being measured.

messages

should compilation messages be printed? defaults to true.

Value

list with evaluated measurement process functions and objects. The list contains the following objects:

meas_procs

list of parsed measurement process functions

meas_pointers

external pointers to compiled functions to simulate from and evaluate the density of the measurement process

obstimes

complete vector of observation times

obstime_inds

list of indices (C++) of observation times for each of the measurement variables

obsmat

either a template for an observation matrix, or an observation matrix that combines the supplied list of observation matrices

obscomp_codes

named numeric vector of measurement variable codes

measproc_indmat

indicator matrix for which measurement variables are measured at which observation times

meas_inds

indices (C++) of elements in the observation matrix that correspond to measurements (non-NAs)

censusmat

template matrix for storing the compartment counts at observation times

tcovar_censmat

matrix with time-varying coviates censused at observation times

lna_prevalence

indicator for whether prevalence is computed in the LNA

lna_incidence

indicator for whether incidence is computed in the LNA

incidence_codes_lna

C++ column indices for LNA count processes on transition events for which incidence is to be computed


fintzij/stemr documentation built on March 25, 2022, 12:25 p.m.