| passage_time | R Documentation |
Computes the full matrix of mean first passage times (MFPT) for a Markov
chain. Element M_{ij} is the expected number of steps to travel from
state i to state j for the first time. The diagonal equals
the mean recurrence time 1/\pi_i.
passage_time(x, states = NULL, normalize = TRUE)
## S3 method for class 'net_mpt'
summary(object, ...)
## S3 method for class 'net_mpt'
plot(
x,
log_scale = TRUE,
digits = 1,
title = "Mean First Passage Times",
low = "#004d00",
high = "#ccffcc",
...
)
x |
A |
states |
Character vector. Restrict output to these states.
|
normalize |
Logical. If |
object |
A |
... |
Ignored. |
log_scale |
Logical. Apply log transform to the fill scale for better
contrast? Default |
digits |
Integer. Decimal places displayed in cells. Default |
title |
Character. Plot title. |
low |
Character. Hex colour for the low end (short passage time).
Default dark green |
high |
Character. Hex colour for the high end (long passage time).
Default pale green |
Uses the Kemeny-Snell fundamental matrix formula:
M_{ij} = \frac{Z_{jj} - Z_{ij}}{\pi_j}, \quad
Z = (I - P + \Pi)^{-1}
where \Pi_{ij} = \pi_j. Requires an ergodic (irreducible,
aperiodic) chain.
An object of class "net_mpt" with:
Full n \times n MFPT matrix. Row i, column
j = expected steps from state i to state j.
Diagonal = mean recurrence time 1/\pi_i.
Named numeric vector: stationary distribution \pi.
Named numeric vector: 1/\pi_i per state.
Character vector of state names.
summary.net_mpt returns a data frame with one row per state
and columns state, return_time, stationary,
mean_out (mean steps to other states), mean_in (mean steps
from other states).
Kemeny, J.G. and Snell, J.L. (1976). Finite Markov Chains. Springer-Verlag.
markov_stability, build_network
net <- build_network(as.data.frame(trajectories), method = "relative")
pt <- passage_time(net)
print(pt)
plot(pt)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.