Skip to main content

UNKNOWN

Project description

Overview

This is a python module for calculating global (Moran’s I [1]) and local spatial autocorrelation [1.5] using the AMOEBA algorithm [2]. This code works on shapefiles, although a base class is provided to allow the examination of other objects, e.g. from a spatial database.

Usage

The easiest way is to call autocorrelate.py with the name and path of the shapefile, e.g.:

python autocorrelate.py path/to/file/filename.shp

To use in other python programs:

from lcia_autocorrelation.ac_shapefile import AutocorrelationShapefile
ac = AutocorrelationShapefile("filepath")
ac.global_autocorrelation()

Autocorrelation calculations are made using the PySAL library; multiple measures of autocorrelation are possible.

Local Indicators of Spatial Autocorrelation (LISA)

Moran’s I (http://en.wikipedia.org/wiki/Moran’s_I) is a single statistic for glboal autocorrelation. However, the calculation of Moran’s I involves summing the individual cross products of each spatial unit. Local indicators of spatial association (LISA) (Anselin, L. (1995). “Local indicators of spatial association – LISA”. Geographical Analysis, 27, 93-115) uses these local indicators directly, to calculate a local measure of clustering or autocorrelation. The LISA statistic is:

\begin{equation*} I_{i} = \frac{Z_{i}}{}\sum_{j}W_{ij}Z_{j} I = \sum_{i}\frac{I_{i}}{N} \end{equation*}

Where I is the autocorrelation statistic, Z is the deviation of the variable of interest from the average, and W is the spatial weight linking i to j.

We use the PySAL library (http://code.google.com/p/pysal/) to calculate LISA statistics (http://pysal.org/users/tutorials/autocorrelation.html#local-indicators-of-spatial-association).

Installation

Using pip:

pip install lcia-autocorrelation

Using easy_install:

easy_install lcia-autocorrelation

Requirements

The following packages are required

  • numpy

  • scipy

  • pysal

  • rtree

  • osgeo

  • django

  • progressbar

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

py_amoeba-0.2.1.tar.gz (7.9 kB view details)

Uploaded Source

File details

Details for the file py_amoeba-0.2.1.tar.gz.

File metadata

  • Download URL: py_amoeba-0.2.1.tar.gz
  • Upload date:
  • Size: 7.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for py_amoeba-0.2.1.tar.gz
Algorithm Hash digest
SHA256 ed0ff4caf27a68a5c397a3f9b999e8e09f57e1112bd485f6d05bc2f9bb52a033
MD5 27b351b71587c6ddb1cec35552f9db4c
BLAKE2b-256 8ab9c51e0d5f6a55ed1873be2380d9a08878c8d7c3c881b62d848c947896749f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page