state_trans: Make state transitions.

Description Usage Arguments Value Examples

Description

Take in the matrix of the states of synthetic population (created by syn_pop function) and calculate the transitions from one state to other state(s) using the transition rate(s).

Usage

1
state_trans(origin, new.states, params, s.matrix)

Arguments

origin

A number which represents the column index s.matrix you want to do the transition from

new.states

A numeric vector or a number which represents the column index s.matrix you want as the destination(s) for the transition

params

A numeric vector of similar length to new.states which serves as the transition rate(s)

s.matrix

A state matrix created from syn_pop function

Value

A transition matrix of the same dimension as s.matrix. -1 indicates that the individual has left the corresponding state. +1 indicates that the individual has become the corresponding state.

Examples

1
2
3
pop <- syn_pop(c(19,1,0,0))
state_trans(1,2,.1,pop)
state_trans(1,4,100,pop)

ibmcraftr documentation built on May 1, 2019, 11:31 p.m.