giddy.rank.
Tau_Regional
(x, y, regime, permutations=0)[source]¶Inter and intraregional decomposition of the classic Tau.
Parameters: |
|
---|
Notes
The equation for calculating inter and intraregional Tau statistic can be found in [Rey16] Equation (27).
Examples
>>> import libpysal as ps
>>> import numpy as np
>>> from giddy.rank import Tau_Regional
>>> np.random.seed(10)
>>> f = ps.io.open(ps.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]))
>>> r = y / y.mean(axis=0)
>>> regime = np.array(f.by_col['esquivel99'])
>>> res = Tau_Regional(y[:,0],y[:,-1],regime,permutations=999)
>>> res.tau_reg
array([[1. , 0.25 , 0.5 , 0.6 , 0.83333333,
0.6 , 1. ],
[0.25 , 0.33333333, 0.5 , 0.3 , 0.91666667,
0.4 , 0.75 ],
[0.5 , 0.5 , 0.6 , 0.4 , 0.38888889,
0.53333333, 0.83333333],
[0.6 , 0.3 , 0.4 , 0.2 , 0.4 ,
0.28 , 0.8 ],
[0.83333333, 0.91666667, 0.38888889, 0.4 , 0.6 ,
0.73333333, 1. ],
[0.6 , 0.4 , 0.53333333, 0.28 , 0.73333333,
0.8 , 0.8 ],
[1. , 0.75 , 0.83333333, 0.8 , 1. ,
0.8 , 0.33333333]])
>>> res.tau_reg_pvalues
array([[0.782, 0.227, 0.464, 0.638, 0.294, 0.627, 0.201],
[0.227, 0.352, 0.391, 0.14 , 0.048, 0.252, 0.327],
[0.464, 0.391, 0.587, 0.198, 0.107, 0.423, 0.124],
[0.638, 0.14 , 0.198, 0.141, 0.184, 0.089, 0.217],
[0.294, 0.048, 0.107, 0.184, 0.583, 0.25 , 0.005],
[0.627, 0.252, 0.423, 0.089, 0.25 , 0.38 , 0.227],
[0.201, 0.327, 0.124, 0.217, 0.005, 0.227, 0.322]])
Attributes: |
|
---|