3.2 Local Geary

Local geary is a type of LISA that focuses on squared differences/dissimilarity. A small value of the local geary statistics suggests positive spatial autocorrelation, whereas large values suggest negative spatial autocorrelation. For more details, please read: http://geodacenter.github.io/workbook/6b_local_adv/lab6b.html#local-geary

local_geary()

local_geary() is a PostgreSQL WINDOW function. Please call it with an OVER clause.

Synopsis

Short version:

float[] local_geary(numeric val,  bytea weights)

Full version:

float[] local_geary(numeric val,  bytea weights,
    integer permutations, 
    character varying permutation_method,
    float significance_cutoff, 
    integer cpu_threads, 
    integer seed)

Arguments

Name

Type

Description

val

numeric

the numeric column that contains the values for LISA statistics

weights

bytea

the bytea column that stores the spatial weights information

permutations

integer

the number of permutations for the LISA computation. Default: 999.

permutation_method

character varying

the permutation method used for the LISA computation. Options are 'complete', 'lookup'. Default: 'lookup'.

significance_cutoff

float

the cutoff value for significance p-values to filter not-significant clusters. Default: 0.05.

cpu_threads

integer

the number of CPU threads used for parallel LISA computation. Default: 6.

seed

integer

the seed for random number generator used in LISA statistics. Default: 123456789.

Return

Type

Description

float[]

an array contains 3 values, which are {'lisa value', 'pseudo-p value' and 'cluster indicator'}

Examples

Apply local geary statistics on the variable "hr60" (homicide rate 1960 in natregimes dataset) using queen contiguity weights "queen_w":

Please see chapter 'Contiguity Based Weights' for how to create a Queen contiguity weights.

SELECT local_geary(hr60, queen_w) OVER() FROM natregimes;

           local_geary           
---------------------------------
 {0.0845829635536199,0.1,0}
 {0.204867720612118,0.203,0}
 {0.0688097067379556,0.061,0}
 ...

One can specify the arguments of local geary using the full version of local_geary() function. For example, apply local geary statistics using 9,999 permutations, significance cutoff value 0.01:

SELECT local_geary(
    hr60, queen_w, 9999, 'lookup', 0.01, 6, 123456789
) OVER() FROM natregimes;

           local_geary            
----------------------------------
 {0.0845829635536199,0.1042,0}
 {0.204867720612118,0.1962,0}
 {0.0688097067379556,0.0624,0    
 ...

Cluster Indicators

The predefined values of the cluster indicators of local moran are:

Cluster indicator value

Description

Color

0

Not significant

#eeeeee

1

High-High

#b2182b

2

Low-Low

#ef8a62

3

Other Positive

#fddbc7

4

Negative

#67adc7

5

Undefined Value

#464646

6

Isolated

#999999

One can extract the cluster indicators and make a local geary cluster map using the 'Color" values in the table above:

SELECT tmp.local_geary[3] FROM (
    SELECT local_geary(hr60, queen_w) OVER() FROM natregimes
) AS tmp;

Or by extracting the pseudo-p values to make a significance map:

SELECT tmp.local_geary[2] FROM (
    SELECT local_geary(hr60, queen_w) OVER() FROM natregimes
) AS tmp;

Last updated