Changelog
Source:NEWS.md
griddy 0.2.0
New features
sojourn_time(),first_passage(), andmobility_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) fromgrd_markovobjects or raw transition probability matrices. Static fixtures validate results against PySALgiddy(ergodic.mfpt,markov.sojourn_time,mobility.markov_mobility).homogeneity_test()tests whether transition dynamics differ across regimes. Forgrd_spatial_markovobjects, it tests whether the matrices conditioned on spatial-lag class differ from the pooled matrix (Rey, Kang, and Wolf 2016). It reports the Pearson chi-squared Q and likelihood-ratio tests with the Bickenbach–Bode (2003) degrees-of-freedom adjustment and the Kullback (1962) information test. Static fixtures validate the first two against PySALgiddy. The Kullback statistic uses the origin-state margins required by the conditional likelihood, which makes it identical to the likelihood-ratio statistic, and it shares the Bickenbach–Bode degrees of freedom. It therefore differs fromgiddy.markov.kullback()through giddy 2.3.9, which uses terminal-state margins (fixed upstream in giddy PR 260) and unadjusted degrees of freedom (see giddy issue 265). A list method accepts arbitrary regime count matrices.
Bug fixes
-
spatial_markov()matched the rows ofgeometry,listw, ornbto units by position, assuming they were in ascending order ofid. Weights in any other row order gave units the wrong neighbors, and no error was raised. This dates from 0.1.0. Rows are now matched by id: through ageometrycolumn with the same name asid, through the column named in the newgeometry_idargument, or through the region ids oflistwandnb.spatial_markov()stops when those ids are missing, duplicated, or do not match the panel. When the weights carry no usable ids, it still matches by position and now warns. Results for weights sorted byidare unchanged.
Documentation
New article, “Coverage of PySAL giddy”, maps every public entry of giddy 2.3.9 to a
griddyfunction, a short recipe, a planned feature, or another package.The Get Started vignette covers the chain summaries and homogeneity tests.
New article, “Usage Guide for LLMs and Agents”, gives language models and coding agents the exact current API, the common pitfalls, and what
griddydoes not cover.The website now publishes
llms.txt, an index for language models, and a Markdown version of every page.The GitHub repository includes an
AGENTS.mdwith guidance for AI coding agents contributing togriddy. It is not part of the installed package.
griddy 0.1.1
This version was tagged on GitHub but not released to CRAN. Its changes reach CRAN in 0.2.0.
Performance
-
spatial_markov(),markov_dynamics(), andrank_mobility(compare = "adjacent")replace per-unit groupeddplyr::lead()calls with a vectorized within-group shift, andspatial_markov()computes spatial lags with a single matrixspdep::lag.listw()call instead of one call per period. On a 3,600-unit, 10-period panelspatial_markov()runs about 4x faster. Outputs are unchanged.
griddy 0.1.0
CRAN release: 2026-05-30
Initial CRAN release.
Workflow
-
classify_dynamics(),markov_dynamics(),spatial_markov(), andrank_mobility()accept longsfpanels keyed by explicitid,time, andvaluecolumns. -
transition_matrix(),steady_state(),class_intervals(), andlag_intervals()provide tidy access to results. -
plot_transition_matrix(),plot_spatial_markov(), andplot_rank_mobility()returnggplot2objects.
Spatial weights
-
spatial_markov()accepts ageometryargument: ansftibble with one row per spatial unit andnb/wtlist-columns produced bysfdep. This is the preferred input.listwandnbarguments remain accepted for compatibility with prior workflows and oracle comparisons.
Data
- Bundled
usjoin: 48 contiguous US state per-capita personal income, 1929–2009, mirroring PySAL’s reference dataset for spatial Markov examples.
Validation
- Static fixtures cross-checked against
estdaR::sp.mkv()andspdyn::spMarkov(). Optional live cross-checks run when those packages or PySALgiddyare installed.