esda.Geary¶
-
class esda.Geary(y, w, transformation=
'r', permutations=999)[source]¶ Global Geary C Autocorrelation statistic
- Parameters:¶
- y : array¶
(n, 1) attribute vector
- w : W | Graph¶
spatial weights instance as W or Graph aligned with y
- 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.
- permutations : int¶
number of random permutations for calculation of pseudo-p_values
- p_sim[source]¶
(if permutations!=0) p-value based on permutations (one-tailed) null: sptial randomness alternative: the observed C is extreme it is either extremely high or extremely low
- p_z_sim[source]¶
(if permutations!=0) p-value based on standard normal approximation from permutations (one-tailed)
Examples
>>> import libpysal >>> import numpy >>> from esda import Geary >>> w = libpysal.io.open(libpysal.examples.get_path("book.gal")).read() >>> f = libpysal.io.open(libpysal.examples.get_path("book.txt")) >>> y = numpy.array(f.by_col['y']) >>> c = Geary(y, w, permutations=0) >>> round(c.C, 7) np.float64(0.3330108) >>> round(c.p_norm, 7) np.float64(9.2e-05)Notes
Technical details and derivations can be found in [Cliff and Ord, 1981].