Formulas Reference — Companion Guide

This companion guide explains the three formulas in plain language with small numeric examples.

Use this alongside:


Section 1: Per-region coherence

Main formula:

$$\text{coherence} = \frac{\text{spread_ratio}}{1 + \text{dispersion}}$$

What each part means

Step-by-step

  1. Collect all endpoint coordinates in one region.
  2. Compute centroid by averaging all x values and all y values.
  3. Compute each endpoint's distance to centroid.
  4. Compute:
    - $\text{spread_ratio} = \max(d)/\min(d)$
    - $\text{dispersion} = \sigma_d/\mu_d$
  5. Compute coherence:
    - $\text{coherence} = \text{spread_ratio}/(1+\text{dispersion})$

Working example

Distances to centroid: 4, 5, 5, 6

Coherence:

$$\text{coherence}=\frac{1.5}{1+0.142}=\frac{1.5}{1.142}\approx1.31$$

Interpretation: higher coherence means stronger geometric organisation around that region's centroid.


Section 2: Diversity coefficient between two regions

Main formula:

$$\sigma_{ij} = \frac{|c_i - c_j|}{\max(c_i, c_j)}$$

What each part means

Working examples

Example A:

Example B:

Interpretation:


Section 3: Pair-loss regression

Main formula (run-2 operational dataset):

$$\text{Loss} = -5.5567\,\sigma + 16.2611, \quad R^2=0.2035$$

What each part means

Working examples

If $\sigma=0$:

$$\text{Loss}=-5.5567(0)+16.2611=16.2611$$

If $\sigma=0.5$:

$$\text{Loss}=-5.5567(0.5)+16.2611=13.48275$$

If $\sigma=0.9$:

$$\text{Loss}=-5.5567(0.9)+16.2611=11.26007$$

Interpretation: in this run, higher pair contrast predicts lower loss.

Because this run-2 line is regressive (downward slope), the slope term is negative: $-5.5567$. If the relationship were positive (upward slope), this coefficient would be positive instead.

Note on $R^2$

Definition:

$$R^2 = 1 - \frac{SS_{res}}{SS_{tot}}$$

Simple terms:

Manual workflow for one point (example at $\sigma=0.35$):

  1. Compute the line value at that x-position:
  2. Read the actual observed value for that same point from the scatter:
  3. Compute residual (vertical gap):
  4. Square it:
  5. Repeat for every point and sum:

Quick map across sections

  1. Section 1 gives one coherence value per region.
  2. Section 2 compares two region coherence values.
  3. Section 3 models pair loss from the Section 2 value across all pairs.

Math mechanics

This section states the same ideas in explicit mathematical mechanics, so you can explain both the intuition and the formal basis.

A. Why Formula 1 is structure-sensitive but scale-invariant

Formula 1:

$$ ext{coherence} = \frac{\max(d)/\min(d)}{1 + \sigma_d/\mu_d} $$

If every distance is multiplied by a constant $k>0$ (uniform scaling), then:

So coherence is unchanged by pure size scaling. It responds to geometric arrangement, not absolute scale.

B. Why Formula 2 is normalized and bounded

Formula 2:

$$ \sigma_{ij} = \frac{|c_i-c_j|}{\max(c_i,c_j)} $$

For nonnegative coherence values:

Hence $0 \le \sigma_{ij} \le 1$. This makes pair comparisons commensurable across different magnitude levels.

C. How the regression coefficients are mechanically obtained

Let $x=\sigma$ and $y=\text{Loss}$. Linear regression fits:

$$ \hat y = mx + b $$

by minimizing:

$$ \sum_i\left(y_i-(mx_i+b)\right)^2 $$

Closed-form coefficients:

$$ m = \frac{\operatorname{Cov}(x,y)}{\operatorname{Var}(x)}, \qquad b = \bar y - m\bar x $$

So the slope sign comes from covariance:

D. Residuals and what $R^2$ is actually measuring

For each point:

$$ e_i = y_i - \hat y_i $$

Residuals are vertical gaps on the plot (not geometric shortest distance to the line).

Then:

$$ R^2 = 1 - \frac{SS_{res}}{SS_{tot}} = 1 - \frac{\sum_i e_i^2}{\sum_i (y_i-\bar y)^2} $$

Interpretation: fraction of total variation in observed Loss explained by the fitted line.

E. 20-second mechanics script (presentation-ready)

  1. Formula 1 compresses region geometry into a scale-invariant coherence score.
  2. Formula 2 turns two coherence scores into a normalized contrast in $[0,1]$.
  3. Formula 3 regresses pair Loss on that contrast across all pairs; the slope sign is set by covariance.