Description Usage Arguments Value See Also Examples
sim_markov_backward
returns a simulated realisation of a Markov chain backwards in time from a known value and time.
1 | sim_markov_backward(num_states, fixed_values, behav_params)
|
num_states |
Numeric, number of (behavioural) states in the Markov chain. |
fixed_values |
List with components:
|
behav_params |
List with components:
|
List with the components:
times
Vector, switching times of the simulation. Includes the fixed end points.
states
Vector, states at switching times of the simulation. Includes the fixed end points.
calc_markov_steady_state
and calc_reverse_markov_gen
for calculating
Markov steady state/equilibrium distribution and reverse-time generator matrices, respectively.
Other Markov chain simulations: calc_markov_steady_state
,
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 | end_points <- list(inc_times = c(0,10),
inc_behav = c(3))
param <- list(lambda = c(0.1,0.2,0.3),
q = matrix(c(NA,0.5,0.3,0.35,NA,0.7,0.65,0.5,NA),nrow=3))
set.seed(123)
sim_markov_backward(3, end_points, param)
# $times
# [1] 0.000000 7.188476 10.000000
#
# $states
# [1] 1 3 3
set.seed(2712)
sim_markov_backward(3, end_points, param)
# $times
# [1] 0.000000 4.467302 4.691276 8.101915 10.000000
#
# $states
# [1] 2 3 1 3 3
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.