calc_markov_steady_state: Markov chain equilibrium distribution.

Description Usage Arguments Value See Also Examples

Description

calc_markov_steady_state returns the equilibrium distribution of a Markov chain.

Usage

1
calc_markov_steady_state(num_states, behav_params)

Arguments

num_states

Numeric, number of behavioural states.

behav_params

List with components:

lambda

Vector (length num_states) of switching rates.

q

Matrix (square size num_states with NA diagonal elements) of switching probabilities. Note: row = from, column = to.

Value

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).

See Also

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

Examples

 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

a-parton/CTStepTurn documentation built on May 14, 2019, 4:17 p.m.