Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@turf/moran-index

Package Overview
Dependencies
Maintainers
0
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@turf/moran-index

turf moran-index module

  • 7.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

@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*

  1. Moran's I

  2. pysal

  3. Andy Mitchell, The ESRI Guide to GIS Analysis Volume 2: Spatial Measurements & Statistics.

Parameters

  • fc FeatureCollection<any>

  • options Object

    • options.inputField string the property name, must contain numeric values
    • options.threshold number the distance threshold (optional, default 100000)
    • options.p number the Minkowski p-norm distance parameter (optional, default 2)
    • options.binary boolean whether transfrom the distance to binary (optional, default false)
    • options.alpha number the distance decay parameter (optional, default -1)
    • options.standardization boolean wheter row standardization the distance (optional, default true)

Examples

const bbox = [-65, 40, -63, 42];
const dataset = turf.randomPoint(100, { bbox: bbox });

const result = turf.moranIndex(dataset, {
  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

  • moranIndex number the moran's Index of the observed feature set
  • expectedMoranIndex number the moran's Index of the random distribution
  • stdNorm number the standard devitaion of the random distribution
  • zNorm number 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 single module individually:

$ npm install @turf/moran-index

Or install the all-encompassing @turf/turf module that includes all modules as functions:

$ npm install @turf/turf

Keywords

FAQs

Package last updated on 09 Aug 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc