From 1d9c2f1b58b9e09e1b677243ecd162e6b5cd7166 Mon Sep 17 00:00:00 2001 From: Wei Kang Date: Mon, 24 Jun 2024 10:19:08 -0500 Subject: [PATCH] (doc) add docstrings explaining methods to break ties for categorical spatial lags in spatial markov --- giddy/markov.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/giddy/markov.py b/giddy/markov.py index c3706c2..e10c79c 100644 --- a/giddy/markov.py +++ b/giddy/markov.py @@ -740,7 +740,14 @@ class Spatial_Markov: (4) `Spatial_Markov` also accepts discrete time series and calculates categorical spatial lags on which several transition probability matrices - are conditioned. + are conditioned. The categorical spatial lag is defined as the most common + categories of neighboring observations, weighted by their weight strengths. + + Please note that occasionally there are ties for the "most common categories" + in the calculation of the categorical spatial lag. To break the tie, the + category of the focal observation is included with its neighbors. If this + does not resolve the tie, a winner is chosen randomly. + Let's still use the US state income time series to demonstrate. We first discretize them into categories and then pass them to `Spatial_Markov`.