View source: R/tpm_functions.R
tpm_thinned | R Documentation |
If the transition probability matrix of an inhomogeneous Markov chain varies only periodically (with period length L
), it converges to a so-called periodically stationary distribution.
This happens, because the thinned Markov chain, which has a full cycle as each time step, has homogeneous transition probability matrix
\Gamma_t = \Gamma^{(t)} \Gamma^{(t+1)} \dots \Gamma^{(t+L-1)}
for all t = 1, \dots, L.
This function calculates the matrix above efficiently as a preliminery step to calculating the periodically stationary distribution.
tpm_thinned(Gamma, t)
Gamma |
array of transition probability matrices of dimension c(N,N,L). |
t |
integer index of the time point in the cycle, for which to calculate the thinned transition probility matrix |
thinned transition probabilty matrix of dimension c(N,N)
# setting parameters for trigonometric link
beta = matrix(c(-1, -2, 2, -1, 2, -4), nrow = 2, byrow = TRUE)
# calculating periodically varying t.p.m. array (of length 24 here)
Gamma = tpm_p(beta = beta)
# calculating t.p.m. of thinned Markov chain
tpm_thinned(Gamma, 4)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.