esda.Geary

class esda.Geary(y, w, transformation='r', permutations=999)[source]

Global Geary C Autocorrelation statistic

Parameters:
wW

spatial weights

transformation{‘R’, ‘B’, ‘D’, ‘U’, ‘V’}

weights transformation, default is row-standardized. Other options include “B”: binary, “D”: doubly-standardized, “U”: untransformed (general weights), “V”: variance-stabilizing.

pseudo-p_values

Notes

Technical details and derivations can be found in [CO81].

Examples

>>> import libpysal
>>> from esda.geary import Geary
>>> w = libpysal.io.open(libpysal.examples.get_path("book.gal")).read()
>>> f = libpysal.io.open(libpysal.examples.get_path("book.txt"))
>>> y = np.array(f.by_col['y'])
>>> c = Geary(y,w,permutations=0)
>>> round(c.C,7)
0.3330108
>>> round(c.p_norm,7)
9.2e-05
>>>
Attributes:
wW

spatial weights

vector of I values for permutated samples

p-value based on permutations (one-tailed) null: sptial randomness alternative: the observed C is extreme it is either extremely high or extremely low

average value of C from permutations

variance of C from permutations

standard deviation of C under permutations.

standardized C based on permutations

p-value based on standard normal approximation from permutations (one-tailed)

__init__(y, w, transformation='r', permutations=999)[source]

Methods

__init__(y, w[, transformation, permutations])

by_col(df, cols[, w, inplace, pvalue, outvals])

Function to compute a Geary statistic on a dataframe

classmethod by_col(df, cols, w=None, inplace=False, pvalue='sim', outvals=None, **stat_kws)[source]

Function to compute a Geary statistic on a dataframe

Parameters:
is searched for in the dataframe’s metadata

return a series contaning the results of the computation. If operating inplace, with default configurations, the derived columns will be named like ‘column_geary’ and ‘column_p_sim’

the Geary statistic’s documentation for available p-values

Geary statistic

documentation for the Geary statistic.

Returns:

Notes

Technical details and derivations can be found in [CO81].