esda.Geary¶
-
class
esda.Geary(y, w, transformation='r', permutations=999)[source]¶ Global Geary C Autocorrelation statistic
- Parameters
- yarray
(n, 1) attribute vector
- 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.
- permutationsint
number of random permutations for calculation of 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
- yarray
original variable
- wW
spatial weights
- permutationsint
number of permutations
- Cfloat
value of statistic
- ECfloat
expected value
- VCfloat
variance of G under normality assumption
- z_normfloat
z-statistic for C under normality assumption
- z_randfloat
z-statistic for C under randomization assumption
- p_normfloat
p-value under normality assumption (one-tailed)
- p_randfloat
p-value under randomization assumption (one-tailed)
- simarray
(if permutations!=0) vector of I values for permutated samples
- p_simfloat
(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
- EC_simfloat
(if permutations!=0) average value of C from permutations
- VC_simfloat
(if permutations!=0) variance of C from permutations
- seC_simfloat
(if permutations!=0) standard deviation of C under permutations.
- z_simfloat
(if permutations!=0) standardized C based on permutations
- p_z_simfloat
(if permutations!=0) p-value based on standard normal approximation from permutations (one-tailed)
Methods
by_col(df, cols[, w, inplace, pvalue, outvals])Function to compute a Geary statistic on a dataframe
-
__init__(self, y, w, transformation='r', permutations=999)[source]¶ Initialize self. See help(type(self)) for accurate signature.
Methods
__init__(self, y, w[, transformation, …])Initialize self.
by_col(df, cols[, w, inplace, pvalue, outvals])Function to compute a Geary statistic on a dataframe