tpm_cont function

Calculate continuous time transition probabilities

Calculate continuous time transition probabilities

A continuous-time Markov chain is described by an infinitesimal generator matrix QQ. When observing data at time points t1,,tnt_1, \dots, t_n the transition probabilites between tit_i and ti+1t_{i+1} are caluclated as [REMOVE_ME]Γ(Δti)=exp(QΔti),[REMOVEME2] \Gamma(\Delta t_i) = \exp(Q \Delta t_i), [REMOVE_ME_2]

where exp()\exp() is the matrix exponential. The mapping Γ(Δt)\Gamma(\Delta t) is also called the Markov semigroup . This function calculates all transition matrices based on a given generator and time differences.

tpm_cont(Q, timediff, ad = NULL, report = TRUE)

Arguments

  • Q: infinitesimal generator matrix of the continuous-time Markov chain of dimension c(N,N)
  • timediff: time differences between observations of length n-1 when based on n observations
  • ad: optional logical, indicating whether automatic differentiation with RTMB should be used. By default, the function determines this itself.
  • report: logical, indicating whether Q should be reported from the fitted model. Defaults to TRUE, but only works if ad = TRUE.

Returns

array of continuous-time transition matrices of dimension c(N,N,n-1)

Description

A continuous-time Markov chain is described by an infinitesimal generator matrix QQ. When observing data at time points t1,,tnt_1, \dots, t_n the transition probabilites between tit_i and ti+1t_{i+1} are caluclated as

Γ(Δti)=exp(QΔti), \Gamma(\Delta t_i) = \exp(Q \Delta t_i),

where exp()\exp() is the matrix exponential. The mapping Γ(Δt)\Gamma(\Delta t) is also called the Markov semigroup . This function calculates all transition matrices based on a given generator and time differences.

Examples

# building a Q matrix for a 3-state cont.-time Markov chain Q = generator(rep(-2, 6)) # draw random time differences timediff = rexp(100, 10) # compute all transition matrices Gamma = tpm_cont(Q, timediff)

See Also

Other transition probability matrix functions: generator(), tpm(), tpm_emb(), tpm_emb_g(), tpm_g(), tpm_p()