@turf/moran-index v7.2.0
@turf/moran-index
moranIndex
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 means a clusterd pattern. Moran's I < 0 means a dispersed pattern. Moran's I = 0 means a random pattern.
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.
the z-score can be calculated based on a normal or random assumption.
Bibliography*
Andy Mitchell, The ESRI Guide to GIS Analysis Volume 2: Spatial Measurements & Statistics.
Parameters
fcFeatureCollection<any>optionsObjectoptions.inputFieldstring the property name, must contain numeric valuesoptions.thresholdnumber the distance threshold (optional, default100000)options.pnumber the Minkowski p-norm distance parameter (optional, default2)options.binaryboolean whether transfrom the distance to binary (optional, defaultfalse)options.alphanumber the distance decay parameter (optional, default-1)options.standardizationboolean wheter row standardization the distance (optional, defaulttrue)
Examples
const bbox = [-65, 40, -63, 42];
const dataset = turf.randomPoint(100, { bbox: bbox });
const result = moranIndex(pts, {
inputField: 'CRIME',
});Returns MoranIndex
mean
get mean of a list
Parameters
Returns number
variance
get variance of a list
Parameters
Returns number
MoranIndex
Type: Object
Properties
moranIndexnumber the moran's Index of the observed feature setexpectedMoranIndexnumber the moran's Index of the random distributionstdNormnumber the standard devitaion of the random distributionzNormnumber the z-score of the observe samples with regard to the random distribution
This module is part of the Turfjs project, an open source module collection dedicated to geographic algorithms. It is maintained in the Turfjs/turf repository, where you can create PRs and issues.
Installation
Install this module individually:
$ npm install @turf/moran-indexOr install the Turf module that includes it as a function:
$ npm install @turf/turf11 months ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
4 years ago
4 years ago
5 years ago
5 years ago
5 years ago
5 years ago
6 years ago
8 years ago
8 years ago