| markov_stability | R Documentation |
Computes per-state stability metrics from a transition network: persistence (self-loop probability), stationary distribution, mean recurrence time, sojourn time, and mean accessibility to/from other states.
markov_stability(x, normalize = TRUE)
## S3 method for class 'net_markov_stability'
plot(
x,
metrics = c("persistence", "stationary_prob", "return_time", "sojourn_time",
"avg_time_to_others", "avg_time_from_others"),
...
)
x |
A |
normalize |
Logical. Normalize rows to sum to 1? Default |
metrics |
Character vector. Which metrics to plot. Options:
|
... |
Ignored. |
Sojourn time is the expected consecutive time steps spent in a
state before leaving: 1/(1-P_{ii}). States with
persistence = 1 have sojourn_time = Inf.
avg_time_to_others: mean passage time from this state to all others; reflects how "sticky" or "isolated" the state is.
avg_time_from_others: mean passage time from all other states to this one; reflects accessibility (attractor strength).
An object of class "net_markov_stability" with:
Data frame with one row per state and columns:
state, persistence (P_{ii}),
stationary_prob (\pi_i),
return_time (1/\pi_i),
sojourn_time (1/(1-P_{ii})),
avg_time_to_others (mean MFPT leaving state i),
avg_time_from_others (mean MFPT arriving at state i).
The underlying net_mpt object.
passage_time
net <- build_network(as.data.frame(trajectories), method = "relative")
ms <- markov_stability(net)
print(ms)
plot(ms)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.