Skip to contents

Analyzes whether basin pairs have more or less overlap than expected under independence. Computes raw deviations and standardized Pearson residuals.

Usage

gfassoc.deviation(overlap.matrix)

Arguments

overlap.matrix

A numeric matrix (one of the overlap matrices from gfassoc.overlap).

Value

A list containing:

delta

Matrix of raw deviations \(O_{ij} - E_{ij}\).

zeta

Matrix of standardized Pearson residuals.

expected

Matrix of expected overlaps under independence.

Details

Under independence, the expected overlap is:

$$E_{ij} = \frac{(\sum_k O_{ik})(\sum_l O_{lj})}{\sum_{k,l} O_{kl}}$$

The raw deviation \(\delta_{ij} = O_{ij} - E_{ij}\) measures the difference from expected. The standardized deviation \(\zeta_{ij}\) follows the Pearson residual form, providing a scale-free measure suitable for comparing across different matrix sizes.

Large positive zeta values indicate basin pairs that overlap more than expected (attraction). Large negative values indicate pairs that overlap less than expected. These are descriptive residuals, not calibrated tests or evidence of causal attraction/repulsion.