Skip to contents

Calculate the prior probability of states that correspond to the stationary distribution of the transition matrix T

Usage

get_pi(mat_T = NULL)

Arguments

mat_T

(matrix) transition matrix

Value

A numeric vector

Details

It is assumed that the prior probability of states corresponds to the stationary distribution of the transition matrix \(T\), denoted with \(\pi\) and its entries with \(\pi_i=Pr(\theta_{l-1}=i)\).

Examples

T_mat <- rbind(c(1-0.01,0.01,0),
               c(0.01,1-0.02,0.01),
               c(0,0.01,1-0.01))
T_mat
#>      [,1] [,2] [,3]
#> [1,] 0.99 0.01 0.00
#> [2,] 0.01 0.98 0.01
#> [3,] 0.00 0.01 0.99
get_pi(T_mat)
#> [1] 0.3333333 0.3333333 0.3333333