sojourn_time(), first_passage(), and mobility_index() compute expected
sojourn times, Kemeny--Snell mean first-passage times, and scalar Markov
mobility indices (Prais--Shorrocks, determinant, Sommers--Conlisk
eigenvalue, and both Bartholomew indices) from grd_markov objects or raw
transition probability matrices. Results are validated against PySAL
giddy (ergodic.mfpt, markov.sojourn_time,
mobility.markov_mobility) via static fixtures.
homogeneity_test() tests whether transition dynamics differ across
regimes -- for grd_spatial_markov objects, whether the matrices
conditioned on spatial-lag class differ from the pooled matrix (Rey, Kang,
and Wolf 2016). Reports the Pearson chi-squared Q and likelihood-ratio
tests with the Bickenbach--Bald (2003) degrees-of-freedom adjustment and
the Kullback (1962) information test. The first two are validated against
PySAL giddy via static fixtures. The Kullback statistic uses the
origin-state margins required by the conditional likelihood, deliberately
differing from giddy.markov.kullback() through giddy 2.3.9 when transition
tables are not flow-balanced. A list method accepts arbitrary regime count
matrices.
spatial_markov(), markov_dynamics(), and rank_mobility(compare = "adjacent") replace per-unit grouped dplyr::lead() calls with a
vectorized within-group shift, and spatial_markov() computes spatial lags
with a single matrix spdep::lag.listw() call instead of one call per
period. On a 3,600-unit, 10-period panel spatial_markov() runs about 4x
faster. Outputs are unchanged.Initial CRAN release.
classify_dynamics(), markov_dynamics(), spatial_markov(), and
rank_mobility() accept long sf panels keyed by explicit id, time, and
value columns.transition_matrix(), steady_state(), class_intervals(), and
lag_intervals() provide tidy access to results.plot_transition_matrix(), plot_spatial_markov(), and
plot_rank_mobility() return ggplot2 objects.spatial_markov() accepts a geometry argument: an sf tibble with one
row per spatial unit and nb / wt list-columns produced by sfdep. This
is the preferred input. listw and nb arguments remain accepted for
compatibility with prior workflows and oracle comparisons.usjoin: 48 contiguous US state per-capita personal income,
1929–2009, mirroring PySAL's reference dataset for spatial Markov examples.estdaR::sp.mkv() and
spdyn::spMarkov(). Optional live cross-checks run when those packages or
PySAL giddy are installed.