# LISA

In addition to various [binning strategies](https://github.com/nofurtherinformation/webgeoda-gitbook/tree/3f52ced9327a8784263a72795b1b25a75f375435/variables/variables/binning-types.md), you can specify a variable that identifies statistically significant local clusters, also known as Local Indicators of Spatial Autocorrelation (or LISAs; [Anselin, 1995](https://onlinelibrary.wiley.com/doi/pdf/10.1111/j.1538-4632.1995.tb00338.x)). The LISA statistic identifies a hotspot where a core location and its neighbors are above average for the data and they have significant correlation, relative to a random spatial distribution (known as the reference distribution). For coldspots, the same LISA statistic finds areas below average. Spatial outliers are locations with above-average core locations and below-average neighbors or vice versa. Spatial clusters and outliers are displayed at a certain pseudo significance level (such as 0.05 or 0.01), and by default, only cluster core locations are displayed.

## Specifying LISA Variables

```javascript
    // ...variables
    {
        variable: "Population Density Hotspot",
        numerator: "acs_data",
        nProperty: "Total Population",
        denominator: "acs_data",
        dProperty: "Area Land",
        lisa: true
    }
```

## LISA Options

By default, WebGeoDa uses Local Moran's I algorithm ([Anselin, 1995](https://onlinelibrary.wiley.com/doi/pdf/10.1111/j.1538-4632.1995.tb00338.x)) to calculate local spatial autocorrelation. You can specify an alternate LISA function with the `lisaFunction` parameter in your LISA variable spec.`lisaFunction` should be the name of a [jsGeoDa local spatial autocorrelation function](https://xunli.gitbook.io/jsgeoda/local-spatial-autocorrelation/local-moran). For more background on LISA statistics, visit GeoDa's [intro to spatial data analysis docs](https://geodacenter.github.io/workbook/6a_local_auto/lab6a.html).

Additionally, you can provide additional LISA parameters for your jsGeoDa LISA function in `lisaParams`. The map ID and spatial weights ID will be automatically provided to jsGeoDa, but additional parameters can be provided as an array:

```javascript
    // ...variables
    {
        // ...variable spec
        lisa: true,
        lisaFunction: 'localGeary',
        lisaParams: [
            999, // Number permutations, 
            'lookup',// String permutation_method,
            0.05, // NUmber significance_cutoff, 
            123456789 // Number seed
        ]
    }
```

See [jsGeoDa docs](https://xunli.gitbook.io/jsgeoda/local-spatial-autocorrelation/local-moran) for futher information on LISA calculations and parameters.

## Spatial Weights Options

By default, WebGeoDa uses Queen's Weights, but you can specify a preferred way to calculate spatial weights (such as distance weights or kernel weights). You specify this by calling the `weightsFunction` parameter in your LISA variable spec. `weightsFunction` should be the name of a [jsGeoDa weights function](https://xunli.gitbook.io/jsgeoda/spatial-weights/contiguity-based-weights).

Additionally, you can provide additional weights parameters for your jsGeoDa weights function in `weightsParams`. The map ID will be automatically provided to the jsGeoDa weights function, but additional parameters can be provided as an array:

```javascript
    // ...variables
    {
        // ...variable spec
        lisa: true,
        weightsFunction: 'getDistanceWeights',
        weightsParams: [
            500, // Number distBand,
            1, // Number power, 
            false, // Boolean isInverse, 
            false, // Boolean isArc,
            true// Boolean isMile
        ]
    }
```

See [jsGeoDa docs](https://xunli.gitbook.io/jsgeoda/spatial-weights/distance-based-weights) for futher information on weights calculations and parameters.
