Learn R Programming

heemod (version 0.3.3)

define_model: Define a Markov Model

Description

Combine information on parameters, transition matrix and states defined through define_parameters, define_matrix and define_state respectively.

Usage

define_model(..., transition_matrix = define_matrix())
define_model_(transition_matrix, states)

Arguments

...
Object generated by define_state.
transition_matrix
An object generated by define_matrix.
states
List of states, only used by define_model_ to avoid using ....

Value

An object of class uneval_model (a list containing the unevaluated parameters, matrix and states).

Details

This function checks whether the objects are compatible in the same model (same state names...).

Examples

Run this code
mat <- define_matrix(
  state_names = c("s1", "s2"),
  1 / c, 1 - 1/ c,
  0, 1
)

s1 <- define_state(
  cost = 234,
  utility = 1
  )
s2 <- define_state(
  cost = 421,
  utility = .5
  )

define_model(
  transition_matrix = mat,
  s1 = s1,
  s2 = s2
)

Run the code above in your browser using DataLab