define_strategy: Define a Markov Model

View source: R/strategy_define.R

define_strategyR Documentation

Define a Markov Model

Description

Combine information on parameters, transition matrix and states defined through define_parameters(), define_transition() and define_state() respectively.

Usage

define_strategy(
  ...,
  transition = define_transition(),
  starting_values = define_starting_values()
)

define_strategy_(transition, states, starting_values)

Arguments

...

Objects generated by define_state(). Each object should be named with the state names of the transition matrix.

transition

An object generated by define_transition().

starting_values

Optional starting values defined with define_starting_values().

states

List of states, only used by define_strategy_ to avoid using ....

Details

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

State values and transition probabilities referencing state_time are automatically expanded to implicit tunnel states.

Value

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

Examples

mat <- define_transition(
  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_strategy(
  transition = mat,
  s1 = s1,
  s2 = s2
)

heemod documentation built on May 29, 2024, 8:17 a.m.