Skip to main content
Version: 7.3.0

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.

参考文献*

  1. 莫兰指数
  2. pysal
  3. 安迪·米切尔,《ESRI GIS分析指南 第二卷:空间测量与统计》

参数

🌐 Parameters

名称类型描述
fcFeatureCollection<any>
optionsObject
options.inputFieldstring属性名称必须包含数字值
options.threshold?number距离阈值 (默认 100000)
options.p?number闵可夫斯基 p 范数距离参数 (默认 2)
options.binary?boolean是否将距离转换为二进制 (默认 false)
options.alpha?number距离衰减参数 (默认 -1)
options.standardization?boolean是否进行行标准化距离 (默认 true)

返回

🌐 Returns

MoranIndex

示例

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(...);