cds2.spatial
Spatial statistics: Moran's I, Geary's C, nearest-neighbor index.
Spatial statistics: contiguity weights, autocorrelation and point patterns.
MoranResult
dataclass
Outcome of the global Moran's I autocorrelation test.
Source code in src/cds2/spatial.py
27 28 29 30 31 32 33 | |
GearyResult
dataclass
Outcome of the global Geary's C autocorrelation test.
Source code in src/cds2/spatial.py
36 37 38 39 40 41 42 | |
NearestNeighborIndex
dataclass
Mean nearest-neighbour distance compared with complete spatial randomness.
Source code in src/cds2/spatial.py
45 46 47 48 49 50 51 52 | |
build_weight_matrix(points, cutoff=None)
Row-standardised binary contiguity weights linking points within cutoff.
cutoff defaults to the mean nearest-neighbour distance; isolated nodes
receive an all-zero row and the diagonal stays zero.
Source code in src/cds2/spatial.py
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 | |
morans_i(values, weight_matrix)
Global Moran's I; the z score uses the simplified randomisation variance 1/n.
Source code in src/cds2/spatial.py
114 115 116 117 118 119 120 121 122 123 | |
gearys_c(values, weight_matrix)
Global Geary's C; the z score uses the simplified randomisation variance 1/(2n).
Source code in src/cds2/spatial.py
126 127 128 129 130 131 132 133 134 135 | |
nearest_neighbor_index(points, area=None)
Clark-Evans nearest-neighbour index against complete spatial randomness.
area defaults to the bounding-box area; a ratio below 0.95 flags a
clustered pattern and above 1.05 a dispersed one.
Source code in src/cds2/spatial.py
138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 | |