描述
Moran's I 测量与要素关联的属性值模式。 该方法揭示相似值是否倾向于彼此靠近出现,或者高值或低值是否交错出现。
Moran's I > 0 表示聚类模式。 Moran's I < 0 表示分散模式。 Moran's I = 0 表示随机模式。
为了测试结果的有效性,计算 z 分数。 足够正的 z 分数(例如 >1.96)表示聚类, 而足够负的 z 分数(例如 <-1.96)表示分散模式。
z 分数可以基于正态或随机假设计算。
参考书目
- Moran's I
- pysal
- Andy Mitchell, The ESRI Guide to GIS Analysis Volume 2: Spatial Measurements & Statistics.
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| fc | FeatureCollection<any> | |
| options | Object | |
| options.inputField | string | 属性名称,必须包含数值 |
| options.threshold? | number | 距离阈值 (默认 100000) |
| options.p? | number | Minkowski p-范数距离参数 (默认 2) |
| options.binary? | boolean | 是否将距离转换为二进制 (默认 false) |
| options.alpha? | number | 距离衰减参数 (默认 -1) |
| options.standardization? | boolean | 是否行标准化距离 (默认 true) |
返回值
示例
javascript
const bbox = [-65, 40, -63, 42];
const dataset = turf.randomPoint(100, { bbox: bbox });
const result = turf.moranIndex(dataset, {
inputField: "CRIME",
});安装
javascript
$ npm install @turf/moran-index
import { moranIndex } from "@turf/moran-index";
const result = moranIndex(...);javascript
$ npm install @turf/turf
import * as turf from "@turf/turf";
const result = turf.moranIndex(...);