Description Usage Arguments Value See Also Examples
calc_markov_steady_state
returns the equilibrium distribution of a Markov chain.
1 | calc_markov_steady_state(num_states, behav_params)
|
num_states |
Numeric, number of behavioural states. |
behav_params |
List with components:
|
List with components:
steady_state
Vector (length num_states
) giving the equilibrium distribution.
generator
Matrix (square, size num_states
) giving the generator matrix of the Markov chain (just an alternative presentation of behav params).
Other Speed parameters: calc_cond_step_dist
,
calc_step_lik
,
update_speed_param
Other Markov chain simulations: sim_markov_backward
,
sim_markov_bridge
,
sim_markov_forward
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | para <- list(lambda = c(0.1, 0.2),
q = matrix(c(NA, 1, 1, NA), nrow = 2))
calc_markov_steady_state(2, para)
# $steady_state
# [1] 0.6666667 0.3333333
#
# $generator
# [,1] [,2]
# [1,] -0.1 0.1
# [2,] 0.2 -0.2
para <- list(lambda = c(0.1, 0.2, 0.3),
q = matrix(c(NA, 0.5, 0.2, 0.3, NA, 0.8, 0.7, 0.5, NA), nrow = 3))
calc_markov_steady_state(3, para)
$steady_state
# [1] 0.4568528 0.3274112 0.2157360
#
# $generator
# [,1] [,2] [,3]
# [1,] -0.10 0.03 0.07
# [2,] 0.10 -0.20 0.10
# [3,] 0.06 0.24 -0.30
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.