GeospatIal Distribution DYnamics (GIDDY)

Giddy is an open-source python library for the analysis of dynamics of longitudinal spatial data. Originating from the spatial dynamics module in PySAL (Python Spatial Analysis Library), it is under active development for the inclusion of many newly proposed analytics that consider the role of space in the evolution of distributions over time and has several new features including inter- and intra-regional decomposition of mobility association and local measures of exchange mobility in addition to space-time LISA and spatial markov methods.

Installation

giddy supports python 3.5 and 3.6 only. Please make sure that you are operating in a python 3 environment.

Installing released version

giddy is available on the Python Package Index. Therefore, you can either install directly with pip from the command line:

pip install -U giddy

or download the source distribution (.tar.gz) and decompress it to your selected destination. Open a command shell and navigate to the decompressed folder. Type:

pip install .

Installing development version

Potentially, you might want to use the newest features in the development version of giddy on github - pysal/giddy while have not been incorporated in the Pypi released version. You can achieve that by installing pysal/giddy by running the following from a command shell:

pip install git+https://github.com/pysal/giddy.git

You can also fork the pysal/giddy repo and create a local clone of your fork. By making changes to your local clone and submitting a pull request to pysal/giddy, you can contribute to the giddy development.

API reference

Markov Methods

giddy.markov.Markov(class_ids[, classes])

Classic Markov transition matrices.

giddy.markov.Spatial_Markov(y, w[, k, m, …])

Markov transitions conditioned on the value of the spatial lag.

giddy.markov.LISA_Markov(y, w[, …])

Markov for Local Indicators of Spatial Association

giddy.markov.FullRank_Markov(y)

Full Rank Markov in which ranks are considered as Markov states rather than quantiles or other discretized classes.

giddy.markov.GeoRank_Markov(y)

Geographic Rank Markov.

giddy.markov.kullback(F)

Kullback information based test of Markov Homogeneity.

giddy.markov.prais(pmat)

Prais conditional mobility measure.

giddy.markov.homogeneity(transition_matrices)

Test for homogeneity of Markov transition probabilities across regimes.

giddy.markov.sojourn_time(p)

Calculate sojourn time based on a given transition probability matrix.

giddy.ergodic.steady_state(P)

Calculates the steady state probability vector for a regular Markov transition matrix P.

giddy.ergodic.fmpt(P)

Calculates the matrix of first mean passage times for an ergodic transition probability matrix.

giddy.ergodic.var_fmpt(P)

Variances of first mean passage times for an ergodic transition probability matrix.

Directional LISA

giddy.directional.Rose(Y, w[, k])

Rose diagram based inference for directional LISAs.

Economic Mobility Indices

giddy.mobility.markov_mobility(p[, measure, ini])

Markov-based mobility index.

Exchange Mobility Methods

giddy.rank.Theta(y, regime[, permutations])

Regime mobility measure.

giddy.rank.Tau(x, y)

Kendall’s Tau is based on a comparison of the number of pairs of n observations that have concordant ranks between two variables.

giddy.rank.SpatialTau(x, y, w[, permutations])

Spatial version of Kendall’s rank correlation statistic.

giddy.rank.Tau_Local(x, y)

Local version of the classic Tau.

giddy.rank.Tau_Local_Neighbor(x, y, w[, …])

Neighbor set LIMA.

giddy.rank.Tau_Local_Neighborhood(x, y, w[, …])

Neighborhood set LIMA.

giddy.rank.Tau_Regional(x, y, regime[, …])

Inter and intraregional decomposition of the classic Tau.

References

BB03

Frank Bickenbach and Eckhardt Bode. Evaluating the Markov property in studies of economic convergence. International Regional Science Review, 26(3):363–392, 2003. URL: https://doi.org/10.1177/0160017603253789, doi:10.1177/0160017603253789.

Chr05

David Christensen. Fast algorithms for the calculation of kendall’s τ. Computational Statistics, 20(1):51–62, Mar 2005. URL: https://doi.org/10.1007/BF02736122”, doi:10.1007/BF02736122.

FSZ04

John P. Formby, W. James Smith, and Buhong Zheng. Mobility measurement, transition matrices and statistical inference. Journal of Econometrics, 120(1):181–205, 2004. URL: http://www.sciencedirect.com/science/article/pii/S0304407603002112, doi:https://doi.org/10.1016/S0304-4076(03)00211-2.

Ibe09

Oliver Ibe. Markov processes for stochastic modeling. Elsevier Academic Press, Amsterdam, 2009.

KR18

Wei Kang and Sergio J. Rey. Conditional and joint tests for spatial effects in discrete markov chain models of regional income distribution dynamics. The Annals of Regional Science, 61(1):73–93, Jul 2018. URL: https://doi.org/10.1007/s00168-017-0859-9, doi:10.1007/s00168-017-0859-9.

KS67

John G. Kemeny and James Laurie Snell. Finite markov chains. Van Nostrand, 1967.

KKK62

S. Kullback, M. Kupperman, and H. H. Ku. Tests for contingency tables and Markov chains. Technometrics, 4(4):573–608, 1962. URL: http://www.jstor.org/stable/1266291, doi:10.2307/1266291.

PTVF07

William H Press, Saul A Teukolsky, William T Vetterling, and Brian P Flannery. Numerical recipes: the art of scientific computing. Cambridge Univ Pr, Cambridge, 3rd edition, 2007.

Rey01

Sergio J. Rey. Spatial empirics for economic growth and convergence. Geographical Analysis, 33(3):195–214, 2001. URL: https://onlinelibrary.wiley.com/doi/abs/10.1111/j.1538-4632.2001.tb00444.x, doi:10.1111/j.1538-4632.2001.tb00444.x.

Rey04

Sergio J. Rey. Spatial dependence in the evolution of regional income distributions. In A. Getis, J. Múr, and H. Zoeller, editors, Spatial econometrics and spatial statistics, pages 193–213. Palgrave, Hampshire, 2004.

Rey14a

Sergio J. Rey. Fast algorithms for a space-time concordance measure. Computational Statistics, 29(3-4):799–811, 2014. URL: https://doi.org/10.1007/s00180-013-0461-2, doi:10.1007/s00180-013-0461-2.

Rey14b

Sergio J. Rey. Rank-based Markov chains for regional income distribution dynamics. Journal of Geographical Systems, 16(2):115–137, 2014.

Rey16

Sergio J. Rey. Space–time patterns of rank concordance: local indicators of mobility association with application to spatial income inequality dynamics. Annals of the American Association of Geographers, 106(4):788–803, 2016. URL: https://doi.org/10.1080/24694452.2016.1151336, doi:10.1080/24694452.2016.1151336.

RKW16

Sergio J. Rey, Wei Kang, and Levi Wolf. The properties of tests for spatial effects in discrete Markov chain models of regional income distribution dynamics. Journal of Geographical Systems, 18(4):377–398, 2016. URL: http://dx.doi.org/10.1007/s10109-016-0234-x, doi:10.1007/s10109-016-0234-x.

RMA11

Sergio J. Rey, Alan T. Murray, and Luc Anselin. Visualizing regional income distribution dynamics. Letters in Spatial and Resource Sciences, 4(1):81–90, 2011. URL: https://doi.org/10.1007/s12076-010-0048-2, doi:10.1007/s12076-010-0048-2.