What Global Moran’s I Summarizes
A spatial expression vector records one value for each spot, while a spatial neighborhood graph specifies which spots are treated as neighbors and how strongly each pair is weighted. Global Moran’s I combines these two objects into one summary: it measures whether spots connected by the graph tend to have expression deviations with the same or opposite signs. The statistic is global because it aggregates weighted products over the whole graph; it does not identify where a particular cluster occurs.
The graph is part of the definition, not a neutral detail. A result describes expression relative to the chosen weights. Changing the neighborhood rule, the weights, or the spots included can change the statistic. The earlier material on building spatial neighborhood graphs provides the context for choosing such a graph; here the focus is on the statistic computed from it.
The usual setup has nonnegative weights, \(w_{ii}=0\), and a symmetric graph, so \(w_{ij}=w_{ji}\). A binary graph uses weight 1 for a neighboring pair and 0 otherwise; other nonnegative weights can encode relative connection strength. The formula also permits asymmetric weights, but then the double sum represents directed weighted pairs and should be interpreted accordingly. A valid calculation requires at least one positive weight and nonconstant expression values, so that \(S_0>0\) and \(Q>0\). It also requires a single finite expression value for every included spot. For a gene with no variation across the spots, \(Q=0\) and Moran’s I is undefined.
Why the Formula Is a Weighted Covariance Ratio
The numerator is a sum of centered cross-products. For a pair of spots with similar deviations from the mean, \(z_i z_j\) is positive: both are above the mean or both are below it. For deviations with opposite signs, the product is negative. The weights determine how much each pair contributes. Thus a large positive contribution comes from connected spots with deviations pointing in the same direction, while a negative contribution comes from connected spots with deviations in opposite directions.
To make the covariance interpretation precise, define the graph-weighted cross-product average \(C_W\) as the weighted sum of centered products divided by the total weight. Define the empirical variance \(V_n\) using divisor \(n\). Then the Moran statistic is their ratio:
This follows directly by substituting the first two definitions:
So \(I\) compares the weighted average cross-product across graph links with the overall empirical variance of expression. It is not, in general, an ordinary Pearson correlation: the weighted pairs share spots, and the denominator is the variance over spots rather than a product of separately estimated standard deviations over an independent sample of pairs. If \(s^2=Q/(n-1)\) denotes the usual sample variance, then the same relationship can be written \(I=\frac{n}{n-1}\frac{C_W}{s^2}\). The divisor convention matters when translating between expressions.
Worked Example: A Four-Spot Chain
Suppose four spots form a chain, with edges \(1\!-\!2\), \(2\!-\!3\), and \(3\!-\!4\). Use symmetric binary weights: each directed entry for an edge is 1, and all other entries, including the diagonal, are 0. Let the hypothetical expression values be \(x=(1,2,4,5)\).
The mean is \(\bar{x}=(1+2+4+5)/4=3\), so \(z=(-2,-1,1,2)\). The sum of squared deviations is \(Q=4+1+1+4=10\). Each undirected edge appears twice in the double sum, once in each direction. Therefore,
There are three undirected edges and six directed entries with weight 1, so \(S_0=6\). Substitution gives
For the covariance interpretation, \(C_W=6/6=1\) and \(V_n=10/4=2.5\), so \(C_W/V_n=1/2.5=0.4000\). In this example the aggregate weighted cross-product is positive: the two positive edge products outweigh the one negative edge product. This describes the selected graph and these values; it is not, by itself, a test or a claim about a population.
Unequal Weights and Careful Arithmetic
With unequal weights, compute the weighted products before multiplying by the normalization factor \(n/S_0\). If the weights are symmetric, an undirected edge with weight \(a\) contributes \(2a z_i z_j\) to the full double sum, and contributes \(2a\) to \(S_0\). Keeping these two contributions aligned prevents a frequent factor-of-two error.
Worked Example: A Weighted Three-Spot Path
Consider three spots in a path. Give the edge \(1\!-\!2\) weight 1 and the edge \(2\!-\!3\) weight 2, with symmetric weights and zero diagonal. Let hypothetical expression values be \(x=(5,4,2)\). The mean is \(\bar{x}=11/3\), giving \(z=(4/3,1/3,-5/3)\), and
The two undirected edge products are \(z_1z_2=4/9\) and \(z_2z_3=-5/9\). Each edge is counted in both directions, so the full weighted numerator is
The total weight is \(S_0=2(1+2)=6\). Thus
Equivalently, \(C_W=(-4/3)/6=-2/9\) and \(V_n=(14/3)/3=14/9\); their ratio is \((-2/9)/(14/9)=-1/7\). The negative result reflects the weighted combination of one positive and one negative edge product, with the negative product receiving twice the edge weight.
Graph Structure Changes the Summary
The graph decides which cross-products enter the numerator. Two data sets with the same expression values can therefore yield different Moran statistics under different neighborhood definitions. Conversely, a large difference in expression between spots that are not connected does not directly contribute a pair product to the numerator, although those spots still contribute to the overall variance \(Q/n\).
Worked Example: Two Disconnected Spot Pairs
Suppose four spots form two separate edges, \(1\!-\!2\) and \(3\!-\!4\), with symmetric binary weights and no link between the pairs. Let the hypothetical values be \(x=(1,3,10,12)\). Their mean is \(6.5\), so \(z=(-5.5,-3.5,3.5,5.5)\), and
Each connected pair has product \((-5.5)(-3.5)=19.25\) or \((3.5)(5.5)=19.25\). Counting both directions gives a numerator of \(2(19.25+19.25)=77\), and \(S_0=4\). Therefore,
Here \(C_W=77/4=19.25\) and \(V_n=85/4=21.25\), giving \(C_W/V_n=0.9059\). The result summarizes the within-pair products relative to the variance across all four spots. It does not mean that every pair of spots has similar expression, nor does it reveal the spatial arrangement of any other links that were omitted from this graph.
Calculation Checks, Alternatives, and Limitations
Several checks help catch mistakes. Centered deviations should sum to zero, and \(Q\) should be positive unless expression is constant. For symmetric weights, the numerator can be checked by summing over undirected edges and doubling each weighted product. Also verify whether \(S_0\) is the sum of all matrix entries: for a symmetric binary graph, it counts each undirected edge twice. Replacing \(S_0\) by the number of undirected edges while retaining the double-sum numerator changes the statistic.
Another useful check is invariance to common scaling of all weights. If each weight is multiplied by a positive constant \(c\), then both the numerator and \(S_0\) are multiplied by \(c\), leaving \(I\) unchanged. This does not imply that changing the relative weights leaves the statistic unchanged. Row-standardizing a graph, for example, can alter relative weights when spots have different numbers of neighbors, and can therefore change the result.
- Common mistake: counting edges once in the numerator but twice in \(S_0\). For a symmetric graph, either use the full ordered-pair sums in both places or consistently convert both to an undirected-edge formulation. Mixing conventions gives a factor-of-two error.
- Common mistake: treating Moran’s I as a correlation with a universal range of \(-1\) to \(1\). It is a normalized weighted cross-product, but its attainable values depend on the weights and graph. Do not assume the correlation range without a separate justification.
- Common mistake: interpreting a positive value as proof of a spatial process. A positive statistic only describes aggregate alignment of neighboring deviations under the selected graph. It does not establish a cause, statistical significance, or a particular spatial mechanism.
Moran’s I is a compact descriptive summary. It can conceal local patterns that differ across the tissue, and it can be sensitive to how the neighborhood graph is constructed. It also treats the supplied expression vector as the input; it does not itself model count sampling, account for spot mixtures, adjust for covariates, or determine whether an observed value is unusual under a null model. Those are separate questions. Alternatives answer different descriptive questions: an edge-level table preserves which pairs contribute, while other summaries can focus on local structure or distance-dependent variation. None should be treated as interchangeable with this single global graph-weighted ratio.
Check Your Understanding
Answer each question, then compare your reasoning with the solutions below.
- Four spots form a binary-weight chain. Their expression values are \((2,2,6,6)\). Calculate \(I\), showing \(S_0\), the numerator, and \(Q\).
- If every weight in a graph is multiplied by 5, what happens to Moran’s I? Explain using its formula.
- Why can a spot with no neighbors still affect the calculated global Moran’s I if it is included among the \(n\) spots?
- What happens to the definition if all spots have the same expression value?
Solutions. (1) The mean is 4, so \(z=(-2,-2,2,2)\), \(Q=16\), and the chain’s numerator is \(2\{4-4+4\}=8\). Since \(S_0=6\), \(I=(4/6)(8/16)=1/3\). (2) The numerator and \(S_0\) are both multiplied by 5, so their ratio, and hence \(I\), is unchanged. (3) The isolated spot contributes no weighted pair product to the numerator, but its squared deviation contributes to \(Q\), and its inclusion also determines \(n\) and the overall mean. (4) All deviations are zero, so \(Q=0\); Moran’s I is undefined, not zero.