build_rate_mat: Construct a single rate matrix from a vector of rates and a...

Description Usage Arguments Value

View source: R/build_rate_mat.R

Description

Construct a single rate matrix from a vector of rates and a flow matrix.

Usage

1
2
build_rate_mat(rates, state, params, flow, env = NULL, key = NULL,
  update = TRUE)

Arguments

rates

vector containing values of evaluated rates

params

numeric vector of process parameters with element names corresponding exactly to names of parameters used in the rates arguments. The params vector must contain a number of parameters equal to the number of states for the categorical distribution for the state of a subject at t0. The names of these parameters must end in 0 - e.g. for the SIR model: S0, I0, R0. A value of zero for one of the initial distribution parameters will be interpretted as a model assumption that subjects cannot occupy that state at time t0.

flow

numeric matrix of dimension number of transitions x number of compartments. Each row corresponds to a possible transition, and each column in a row has element 1 to indicate an entry to that compartment, -1 to indicate an exit, and 0 for no change in the size of the compartment on the subject level.

env

environment into which to instatiate the rate matrix

key

the key for the hash index

update

TRUE/FALSE for whether to update an existing rate matrix or to instatiate a new one

Value

rate matrix of dimension num_states x num_states


fintzij/BDAepimodel documentation built on Sept. 20, 2020, 1:44 p.m.