terminal_pop | R Documentation |
Joint probabilities of sets of nodes. This is useful to then provide starting state populations to a Markov model.
terminal_pop(model, state_list)
model |
dat_long class |
state_list |
Groups of (usually) terminal nodes; List of vectors |
Vector of probabilities
tree_dat <- tibble::tribble( ~from, ~to, ~vals, ~prob, 1, 2, 10, 0.7, 1, 3, NA, 0.3, 2, 4, 100, 0.1, 2, 5, NA, 0.9, 3, 6, 100, 0.9, 3, 7, NA, 0.1) term_pop <- define_model(dat_long = tree_dat) |> terminal_pop(state_list = c(4,5,6,7)) sum(unlist(term_pop))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.