View source: R/1_model_functions.R
markov_model | R Documentation |
Definition of Markov model and trace
markov_model(
current_strategy,
cycles,
initial_state,
discount = c(0, 0),
parameter_values = NULL,
half_cycle_correction = TRUE,
state_cost_only_prevalent = FALSE,
state_util_only_prevalent = FALSE,
method = "half cycle correction",
startup_cost = NULL,
startup_util = NULL
)
current_strategy |
strategy object |
cycles |
no of cycles |
initial_state |
value of states initially |
discount |
rate of discount for costs and qalys |
parameter_values |
parameters for assigning health states and probabilities |
half_cycle_correction |
boolean to indicate half cycle correction |
state_cost_only_prevalent |
boolean parameter to indicate if the costs for state occupancy is only for those in the state excluding those that transitioned new. This is relevant when the transition cost is provided for eg. in a state with dialysis the cost of previous dialysis is different from the newly dialysis cases. Then the state_cost_only_prevalent should be TRUE |
state_util_only_prevalent |
boolean parameter to indicate if the utilities for state occupancy is only for those in the state excluding those that transitioned new. |
method |
what type of half cycle correction needed |
startup_cost |
cost of states initially |
startup_util |
utility of states initially if any |
Use the strategy, cycles, initial state values creating the markov model and trace. As many probabilities /cost/utility value depend on age/time the evaluation and assignment happens during each cycle. At the heart it does a matrix multiplication using the previous row of the trace matrix and the columns of the transition matrix. Also checks for population loss, calculates cumulative costs and qalys (accounts for discounting and half cycle correction)
Markov trace
tmat <- rbind(c(1, 2), c(3, 4))
colnames(tmat) <- rownames(tmat) <- c("Healthy", "Dead")
tm <- populate_transition_matrix(2, tmat, c(0.5, 0.5, 0, 1))
a <- health_state("Healthy", 1, 1, 0, FALSE)
b <- health_state("Dead", 1, 0, 0, TRUE)
health_states <- combine_state(a, b)
this.strategy <- strategy(tm, health_states, "intervention")
markov_model(this.strategy, 10, c(1, 0))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.