Skip to contents

Local spatial heteroscedasticity (LOSH) (Ord and Getis 2012) is defined as

\[ H_i = \frac{\sum_j w_{ij}\left| e_j \right|^a}{h_1\sum_j w_{ij}} \]

where where \(n\) is the number of spots or locations, \(i\) and \(j\) are different locations, or spots in the Visium context, \(w_{ij}\) is a spatial weight, which can be inversely proportional to distance between spots or an indicator of whether two spots are neighbors, subject to various definitions of neighborhood, \(h_1 = \sum_i \left| e_i \right|^a/n\), \(e_j = x_j - \bar{x}_j\), \(x\) is a variable with values at each location, and

\[ \bar{x}_j = \frac{\sum_j w_{jk}x_k}{\sum_j w_{jk}}. \]

By default, \(a = 2\) so LOSH is like a local variance. See (Ord and Getis 2012) for more details and interpretation.

Below is a list of vignettes that use Moran’s I. The links point to the sections that use Moran’s I. The corresponding Google Colab notebooks are also linked to. The list is sorted by technology.

Vignette Colab Notebook Description
Spatial analysis with 10X example Visium dataset Colab Notebook Perform LOSH on QC metrics in mouse olfactory bulb dataset from 10X website.
Spatial Visium exploratory data analysis Colab Notebook Perform LOSH on gene Myh2 (myosin heavy chain 2) in mouse skeletal muscle dataset
CosMX NSCLC analysis Colab Notebook Perform LOSH on QC metrics and on marker genes in a human non-small cell lung cancer dataset
Xenium breast cancer analysis Colab Notebook Perform LOSH on QC metrics and marker genes in a human breast cancer dataset
10X v3 Basic Colab Notebook Apply LOSH to QC metrics and marker genes in non-spatial human PBMC scRNA-seq dataset, with k nearest neighbor graph in gene expression PCA space rather than histological space

References

Ord, J Keith, and Arthur Getis. 2012. “Local Spatial Heteroscedasticity (LOSH).” Ann. Reg. Sci. 48 (2): 529–39.