Check whether a continuous time Markov chain is time reversible
Source:R/ctmcProbabilistic.R
is.TimeReversible.RdA continuous time Markov chain with stationary distribution \(\pi\) is time reversible if it satisfies the detailed balance equations \(\pi_i Q_{ij} = \pi_j Q_{ji}\) for all states \(i, j\).
Arguments
- ctmc
A
ctmcobject.
Details
The equations are checked up to a relative tolerance of \(\sqrt{\epsilon}\) (about \(1.5 \times 10^{-8}\)) of the largest flow \(\pi_i |Q_{ij}|\), because \(\pi\) is computed numerically. When the chain has several stationary distributions they must all satisfy them.
See also
Other continuous time Markov chains:
ExpectedTime(),
ctmcFit(),
freq2Generator(),
generatorToTransitionMatrix(),
impreciseProbabilityatT(),
is.CTMCirreducible(),
probabilityatT(),
rctmc(),
transition2Generator()
Examples
energyStates <- c("sigma", "sigma_star")
gen <- matrix(c(-3, 3, 1, -1), nrow = 2, byrow = TRUE,
dimnames = list(energyStates, energyStates))
molecularCTMC <- new("ctmc", states = energyStates, byrow = TRUE,
generator = gen, name = "Molecular Transition Model")
is.TimeReversible(molecularCTMC)
#> [1] TRUE
# a birth-death chain is reversible, a cycle is not
s <- c("a", "b", "c")
birthDeath <- matrix(c(-0.3, 0.3, 0,
0.1, -0.5, 0.4,
0, 0.7, -0.7), nrow = 3, byrow = TRUE,
dimnames = list(s, s))
is.TimeReversible(new("ctmc", states = s, byrow = TRUE, generator = birthDeath))
#> [1] TRUE
cycle <- matrix(c(-1, 1, 0, 0, -1, 1, 1, 0, -1), nrow = 3, byrow = TRUE,
dimnames = list(s, s))
is.TimeReversible(new("ctmc", states = s, byrow = TRUE, generator = cycle))
#> [1] FALSE