moranIndex
描述
¥Description
Moran's I 衡量与特性相关的属性值的模式。该方法揭示了相似的值是否倾向于彼此靠近出现,或者高值或低值是否散布。
¥Moran's I measures patterns of attribute values associated with features. The method reveal whether similar values tend to occur near each other, or whether high or low values are interspersed.
Moran's I > 0 表示模式聚集。Moran's I < 0 表示模式分散。Moran's I = 0 表示模式随机。
¥Moran's I > 0 means a clusterd pattern. Moran's I < 0 means a dispersed pattern. Moran's I = 0 means a random pattern.
用于测试结果的显著性。计算 z 分数。足够正的 z 值(例如 >1.96)表示聚类,而足够负的 z 值(例如<-1.96)表示分散模式。
¥In order to test the significance of the result. The z score is calculated. A positive enough z-score (ex. >1.96) indicates clustering, while a negative enough z-score (ex. <-1.96) indicates a dispersed pattern.
z 分数可以基 于正态或随机假设计算。
¥the z-score can be calculated based on a normal or random assumption.
参考文献*
¥Bibliography*
-
Andy Mitchell,《ESRI GIS 分析指南》第 2 卷:空间测量和统计。
¥Andy Mitchell, The ESRI Guide to GIS Analysis Volume 2: Spatial Measurements & Statistics.
参数
¥Parameters
名称 | 类型 | 描述 |
---|---|---|
fc | FeatureCollection<any> | |
options | 对象 | |
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) |
返回
¥Returns
示例
¥Examples
const bbox = [-65, 40, -63, 42];
const dataset = turf.randomPoint(100, { bbox: bbox });
const result = turf.moranIndex(dataset, {
inputField: "CRIME",
});
安装
¥Installation
$ npm install @turf/moran-index
import { moranIndex } from "@turf/moran-index";
const result = moranIndex(...);
$ npm install @turf/turf
import * as turf from "@turf/turf";
const result = turf.moranIndex(...);