Skip to content

Climate slope as simulated, observed and difference; pooled range is the 2.5-97.5% quantiles over ELFs - #29

Merged
eliotmcintire merged 2 commits into
developmentfrom
slopeDifference
Nov 26, 2026
Merged

eliotmcintire merged 2 commits into
developmentfrom
slopeDifference

Conversation

@eliotmcintire

Copy link
Copy Markdown
Contributor

The climate-response table showed the slope as a ratio of simulated to observed. Where the observed climate signal is near zero, that ratio gives wild numbers (for example -3.7 to 13.4 across ELFs) that read as large biases. The slope is now shown in its own units, with the simulated slope, the observed slope and their difference.

Affects: the slope columns of the climate table on the page and the slope rows of wave1_results.csv (measure difference instead of ratio); the pooled ranges over ELFs in the bias and climate tables are narrower (2.5-97.5% instead of min-max).

Technical details

Defects. (1) R/climateResponse.R:31 (ratioTo) divided the sim slope by the obs slope and set NA when the obs slope was near 0. (2) R/ratioTable.R:9-10 (poolRatios()) took min()/max() of the finite ELF values as the pooled range (elfLo, elfHi), and R/bias.R:poolBias() did the same for meanLo/meanHi. The page notes call it "the range over ELFs" next to a 95% single-run range, so one wild ELF set it (slope: -3.69..13.42 vs 2.5-97.5% quantiles -0.72..2.49 over the 47 ELFs).

Fix. Slope per run is sim - obs; the table gets simLo/simHi and the observed slope is observed; an observed slope of 0 gives a finite difference. runSummary() gets at (0 for the slope difference, 1 for ratios), so obsRank for the slope is the share of runs below the observed slope (this also fixes the rank for a negative observed slope). climateResultRows() writes measure difference for the slope. The page table shows Simulated slope, Observed slope, Difference with run range and "obs N%", Driest 10%, Wetter half; the page's ratioCell() takes the reference value (0 for a difference) for the "observed outside" shading; notes rewritten. New elfRange() (2.5-97.5% quantiles of the finite values) is used by poolRatios() and poolBias(); pooled medians are unchanged. NEWS bullets added; no version bump.

Reuses: runSummary() (generalised with at), poolRatios() (range changed in place), longRows(), rangeCell(), ratioCell() (R and page), sortableTable(), medFinite(); new: elfRange() (nothing else computed the 2.5-97.5% range over ELFs; min/max was inline in two places).

Tests (convertToPackage() + test_local(), BLAS/OMP threads 1, data.table 1 thread): branch 127 tests, 664 passed, 0 failed, 0 skipped. Base development with the branch's test files: 29 failed, 1 error (new slope-difference, observed-slope-0, pooled-quantile, measure and page-column tests, plus the two bias range tests). New tests: per-ELF difference on a toy ELF with known slopes (median, range, rank), observed slope 0 finite, pooled row and elfRange(), result measure, page columns in order.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Lx3DXhXsFis2pbqBTh2PPh

… over ELFs is the 2.5-97.5% quantiles

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Lx3DXhXsFis2pbqBTh2PPh
@eliotmcintire eliotmcintire added bug Something isn't working enhancement New feature or request labels Nov 25, 2026
…ange from runSummary(); one 95% range helper

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Lx3DXhXsFis2pbqBTh2PPh
@eliotmcintire
eliotmcintire merged commit d6bc858 into development Nov 26, 2026
3 checks passed
eliotmcintire added a commit that referenced this pull request Nov 26, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Lx3DXhXsFis2pbqBTh2PPh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant