Spatial Durbin / SAR direct-indirect-total decomposition (MRM primitive)
Source:R/mrm_primitives_spatial_spillover.R
mrm_spatial_spillover.RdMirrors the Python module
morie.mrm_primitives.spatial_spillover, adapted from
Laniyonu (2018) Urban Affairs Review 54(5):898-930, which in turn
uses LeSage & Pace (2009) + Elhorst (2010) + the Yang/Noah/Shoff
(2015) decomposition formula.
Details
The Laniyonu (2018) result – gentrification's effect on stops-per-capita is ~0 direct but +51 to +90\ into neighbouring tracts) – only surfaces once you decompose. An OLS or non-spatial FE model would report "no effect" and miss the entire story.
This primitive is the SDM with the canonical decomposition + the Moran's-I diagnostic that justifies SDM over OLS. We deliberately do NOT fit the SDM ourselves – spdep/spatialreg are hard deps we don't want to force. The caller passes the estimated \(\rho\) + \(\beta\) vectors; this primitive does the decomposition arithmetic.