pysal.explore.inequality.gini.
Gini_Spatial
(x, w, permutations=99)[source]¶Spatial Gini coefficient
Provides for computationally based inference regarding the contribution of spatial neighbor pairs to overall inequality across a set of regions. See [RS13].
Parameters: 


Examples
>>> import pysal.lib
>>> import numpy as np
>>> from pysal.explore.inequality.gini import Gini_Spatial
Use data from the 32 Mexican States, Decade frequency 19402010
>>> f=pysal.lib.io.open(pysal.lib.examples.get_path("mexico.csv"))
>>> vnames=["pcgdp%d"%dec for dec in range(1940,2010,10)]
>>> y=np.transpose(np.array([f.by_col[v] for v in vnames]))
Define regime neighbors
>>> regimes=np.array(f.by_col('hanson98'))
>>> w = pysal.lib.weights.block_weights(regimes)
>>> np.random.seed(12345)
>>> gs = Gini_Spatial(y[:,0],w)
>>> gs.p_sim
0.04
>>> gs.wcg
4353856.0
>>> gs.e_wcg
4170356.7474747472
Thus, the amount of inequality between pairs of states that are not in the same regime (neighbors) is significantly higher than what is expected under the null of random spatial inequality.
Attributes: 


__init__
(x, w, permutations=99)[source]¶Initialize self. See help(type(self)) for accurate signature.
Methods
__init__ (x, w[, permutations]) 
Initialize self. 