Description Usage Arguments Value Examples
View source: R/sample_markov.R
This model agnostic function samples a markov model specification using a base R implementation.
See example_two_state_markov
for an example of the required input. Alternatively use sample_markov(type = "base")
passing the
model specification function.
1 2 3 4 5 6 7 8 9 |
transitions |
A function that generates a list of transition matrices,
see |
state_costs |
A function that generates a list of state costs for each intervention,
see |
intervention_costs |
A function that generates a vector of intervention costs, see |
cohorts |
A function that generates a list containing the initial state for each intervention,
see |
qalys |
A function that generates a list of QALYs for each intervention, see |
samples |
Numeric, defaults to 1. The number of samples to take from the Markov model |
type |
A character string specifying the approach to use to sample the model. Currently implemented approaches are "base" and "rcpp" with "rcpp" as the default. |
A data.frame of samples of a model encoded in the SpeedyMarkov
format (see example_two_state_markov
for details).
1 2 3 4 5 6 7 8 9 10 11 12 |
markov_model <- example_two_state_markov()
sample_markov_base(
transitions = markov_model$transitions_list,
cohorts = markov_model$cohorts,
state_costs = markov_model$state_costs,
intervention_costs = markov_model$intervention_costs,
qalys = markov_model$qalys
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.