pysal.explore.giddy.rank.Tau_Local

class pysal.explore.giddy.rank.Tau_Local(x, y)[source]

Local version of the classic Tau.

Decomposition of the classic Tau into local components.

Parameters:
x : array

(n, ), first variable.

y : array

(n, ), second variable.

Notes

The equation for calculating local concordance statistic can be found in [Rey16] Equation (9).

Examples

>>> import pysal.lib as ps
>>> import numpy as np
>>> from pysal.explore.giddy.rank import Tau_Local,Tau
>>> 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)
>>> tau_local = Tau_Local(r[:,0],r[:,1])
>>> tau_local.tau_local
array([-0.03225806,  0.93548387,  0.80645161,  0.74193548,  0.93548387,
        0.74193548,  0.67741935,  0.41935484,  1.        ,  0.5483871 ,
        0.74193548,  0.93548387,  0.67741935,  0.74193548,  0.80645161,
        0.74193548,  0.5483871 ,  0.67741935,  0.74193548,  0.74193548,
        0.5483871 , -0.16129032,  0.93548387,  0.61290323,  0.67741935,
        0.48387097,  0.93548387,  0.61290323,  0.74193548,  0.41935484,
        0.61290323,  0.61290323])
>>> tau_local.tau
0.6612903225806451
>>> tau_classic = Tau(r[:,0],r[:,1])
>>> tau_classic.tau
0.6612903225806451
Attributes:
n : int

number of observations.

tau : float

The classic Tau statistic.

tau_local : array

(n, ), local concordance (local version of the classic tau).

S : array

(n ,n), concordance matrix, s_{i,j}=1 if observation i and j are concordant, s_{i,j}=-1 if observation i and j are discordant, and s_{i,j}=0 otherwise.

__init__(x, y)[source]

Initialize self. See help(type(self)) for accurate signature.

Methods

__init__(x, y) Initialize self.