create_matrix_from_tabular: Create a Transition Matrix From Tabular Input

View source: R/tabular_input.R

create_matrix_from_tabularR Documentation

Create a Transition Matrix From Tabular Input

Description

Transforms tabular input defining a transition matrix into an heRomod object.

Usage

create_matrix_from_tabular(trans_probs, state_names, df_env = globalenv())

Arguments

trans_probs

Result for one model of parse_multi_spec().

state_names

The names of the states used in the transition matrix.

df_env

An environment containing external data.

Details

The data frame trans_probs should have columns from, to, and prob, where prob is the probability of a transition from the from state to the to state. Prob can be defined in terms of parameters, just as when using define_transition at the keyboard. Probabilities of 0 need not be specified - they will be automatically inserted.

All state names must be used in the from column of the transition matrix (otherwise you can just get rid of the state). Absorbing states should have a transition from and to themselves with probability 1.

Value

A transition matrix.


PolicyAnalysisInc/heRoMod documentation built on March 23, 2024, 4:29 p.m.