↖ CPA Weather Lab
SLAM · COMPLETE MATH WALKTHROUGH · FROM THE BEGINNING

From daily rainfall grids to the final SLAM statistics

This version starts at step one. We begin with daily precipitation, identify the annual watershed maximum, build the CAM, compute the ordinary average, then derive the higher L-moments one piece at a time. Only after that do we reach bootstrap distributions, p-values, and FDR.

Step 1. Start with gridded precipitation

Imagine our watershed contains only five grid cells. Real Cumberland County will contain many more, but five is enough to see every calculation.

For one year, suppose we test several 72-hour windows. Each window has one precipitation total for each of the five cells.

72-hour windowCell 1Cell 2Cell 3Cell 4Cell 5
Window A2022252419
Window B3035404550
Window C108012158

SLAM first asks: which window has the largest average across the whole watershed?

Step 2. Compute the watershed-average rainfall for each candidate window

Window A

(20+22+25+24+19)/5 = 22.0 mm

Window B

(30+35+40+45+50)/5 = 40.0 mm

Window C

(10+80+12+15+8)/5 = 25.0 mm
Window B wins. Even though Window C contains one huge 80 mm cell, the watershed as a whole averages only 25 mm. SLAM selects the event that maximizes the watershed-average precipitation.

So for this year, the annual maximum event is:

30, 35, 40, 45, 50 mm

Step 3. Repeat for every year

To keep the example small, use only four years. The real PRISM experiment will use forty-five years.

YearCell 1Cell 2Cell 3Cell 4Cell 5
Year 1 annual-max event3035404550
Year 2 annual-max event2030354055
Year 3 annual-max event2525305060
Year 4 annual-max event1530354575

Step 4. Build the Composite Annual Maximum, or CAM

Now average each grid cell down through the years.

Cell 1

(30+20+25+15)/4 = 22.5

Cell 2

(35+30+25+30)/4 = 30.0

Cell 3

(40+35+30+35)/4 = 35.0

Cell 4

(45+40+50+45)/4 = 45.0

Cell 5

(50+55+60+75)/4 = 60.0

So our CAM is:

22.5, 30.0, 35.0, 45.0, 60.0 mm
Everything that comes next is calculated from these CAM cell values. The time dimension has already been compressed into the CAM.

Step 5. L-mean is just the ordinary average

This is where we should have started last time.

L1 = (22.5 + 30 + 35 + 45 + 60) / 5 = 38.5 mm

That is the L-mean. No special weighting. No probability trick. Just the ordinary arithmetic mean of the CAM cells.

Step 6. Why do we need anything beyond the mean?

Because two CAMs can have the same average but very different spatial patterns.

CAM A

35, 36, 38, 41, 42

Fairly even.

CAM B

10, 20, 30, 50, 82

Much lumpier.

The mean alone cannot describe that difference. So we calculate additional L-moments.

Step 7. Sort the CAM cells

For L-moments, we work with the CAM values ordered from smallest to largest.

x(1) ≤ x(2) ≤ x(3) ≤ x(4) ≤ x(5)
22.5 ≤ 30 ≤ 35 ≤ 45 ≤ 60

The parentheses mean rank order. So x(1) is the smallest cell value and x(5) is the largest.

Step 8. Build the weighted averages needed for higher L-moments

Now we introduce the weighted quantities b₀, b₁, b₂, and b₃. These are not new rainfall data. They are simply different weighted averages of the same sorted CAM values.

The intuition: b₀ treats all cells equally. b₁ gives more influence to wetter-ranked cells. b₂ emphasizes the wettest cells even more. b₃ emphasizes the upper end still more strongly. The L-moment formulas combine these weighted averages so that spread, asymmetry, and tail shape can be measured without using squares, cubes, and fourth powers.

b₀: equal weights

b₀ = (22.5 + 30 + 35 + 45 + 60)/5 = 38.5

b₁: gradually increasing weights

With five observations, the b₁ rank weights are:

0, 1/4, 2/4, 3/4, 4/4
b₁ = (1/5)[ 0(22.5) + 0.25(30) + 0.50(35) + 0.75(45) + 1.00(60)]
b₁ = (1/5)[0 + 7.5 + 17.5 + 33.75 + 60] = 23.75

b₂: stronger emphasis on the upper ranks

With five observations, the b₂ weights are:

0, 0, 1/6, 3/6, 6/6
b₂ = (1/5)[(1/6)(35) + (3/6)(45) + 1(60)]
b₂ = (1/5)[5.8333 + 22.5 + 60] = 17.6667

b₃: strongest emphasis on the wettest ranks

With five observations, the b₃ weights are:

0, 0, 0, 1/4, 4/4
b₃ = (1/5)[0.25(45) + 1(60)]
b₃ = (1/5)[11.25 + 60] = 14.25
You do not need to “believe” these weights. They come from the standard sample L-moment estimator. The important learning point is what they are doing: progressively emphasizing the upper ranks so the later combinations can describe spread and shape.

Step 9. Convert those weighted averages into L₁, L₂, L₃, and L₄

L₁

L₁ = b₀
L₁ = 38.5 mm

The mean.

L₂

L₂ = 2b₁ − b₀
L₂ = 2(23.75) − 38.5 = 9.0 mm

A measure of spatial spread.

L₃

L₃ = 6b₂ − 6b₁ + b₀
L₃ = 6(17.6667) − 6(23.75) + 38.5
L₃ ≈ 2.0 mm

Captures asymmetry.

L₄

L₄ = 20b₃ − 30b₂ + 12b₁ − b₀
L₄ = 20(14.25) − 30(17.6667) + 12(23.75) − 38.5
L₄ ≈ 1.5 mm

Captures tail/peak shape.

Step 10. Normalize the higher L-moments

SLAM compares L-mean directly, but it usually uses ratios for the other three shape statistics.

L-mean
L₁
38.5 mm
L-CV
τ₂ = L₂ / L₁ = 9.0 / 38.5
0.2338
L-skewness
τ₃ = L₃ / L₂ = 2.0 / 9.0
0.2222
L-kurtosis
τ₄ = L₄ / L₂ = 1.5 / 9.0
0.1667
These are now the four numbers SLAM uses to describe the spatial texture of this CAM:

L-mean = overall magnitude
L-CV = spatial spread relative to the mean
L-skewness = spatial asymmetry
L-kurtosis = tail/peak behavior

Step 11. Now create uncertainty with the bootstrap

Our target watershed had four annual-max event maps. A real study has many more. The bootstrap asks how much the four L-moment statistics would change if the observed years had been slightly different.

Sample the annual-max years with replacement.

Original years: 1, 2, 3, 4
One bootstrap sample might be: 2, 2, 4, 1

For that bootstrap sample:

1
Take the event map from Year 2 twice, Year 4 once, and Year 1 once.
2
Average the four event maps cell-by-cell to build a bootstrap CAM.
3
Compute L-mean, L-CV, L-skewness, and L-kurtosis from that bootstrap CAM.
4
Repeat thousands of times. The paper uses 10,000 bootstrap samples.

Now the target watershed has four sampling distributions instead of four single values.

Step 12. Move the polygon and repeat the same calculation

Translate the watershed shape to another grid location.

At that translated position, repeat everything from Step 1:

1
Find the largest watershed-average 72-hour event for each year.
2
Keep the full grid-cell field for each annual winner.
3
Average those fields into a translated CAM.
4
Calculate its L-mean, L-CV, L-skewness, and L-kurtosis.

The winning storm can be different at every translated location.

Step 13. Turn the comparison into p-values

Suppose the translated location has:

L-mean = 39.1 mm, L-CV = 0.240, L-skewness = 0.210, L-kurtosis = 0.180

For each statistic, ask where that translated value falls inside the corresponding target bootstrap distribution.

If it lies near the center, it is ordinary for the target watershed and gets a large p-value.

If it lies way out in either tail, it gets a small p-value.

The test is two-sided. A translated value can be suspicious because it is too high or too low.

Step 14. Repeat across every valid translated position

Every valid location ends up with four p-values:

pmean,   pCV,   pskew,   pkurt

That produces four enormous spatial p-value fields.

Step 15. Apply false discovery rate control

With tens or hundreds of thousands of locations, some tiny p-values will appear by chance. SLAM therefore applies Benjamini-Hochberg false discovery rate control separately to each of the four p-value fields.

p(k) ≤ (k/m) q

where:

p(k) = the k-th smallest p-value

k = its rank

m = total number of tests still being considered

q = chosen global significance level, such as 0.05

SLAM then repeatedly removes the worst offending location and recalculates until the remaining field has no significant tests.

Step 16. Intersect the four surviving maps

A translated position survives only if it passes all four L-moment tests.

PASS = mean-pass ∩ CV-pass ∩ skew-pass ∩ kurtosis-pass

Finally, keep the connected group of passing locations touching the target watershed. Their union becomes the SLAM transposition domain.

Interactive CAM calculator

Change the five CAM values below. This calculator starts at the CAM stage and recomputes the L-moment quantities so you can experiment after understanding where the CAM came from.

Sorted CAM cells
b₀
b₁
b₂
b₃
L₁
L₂
L₃
L₄
L-CV
L-skewness
L-kurtosis
← CPA Weather Lab · Learn