Skip to content

Spatial skill tests S6/S7 (ignition and burn location) and pooled driest-years score - #31

Merged
eliotmcintire merged 3 commits into
developmentfrom
spatial-tests
Dec 1, 2026
Merged

eliotmcintire merged 3 commits into
developmentfrom
spatial-tests

Conversation

@eliotmcintire

Copy link
Copy Markdown
Contributor

Until now every validation test scored yearly totals, so a model that moved fires to the wrong places but kept the totals looked fine. This adds two tests of where ignitions and burns occur, and a score of the driest years pooled over all ELFs, because one ELF has only about 4 such years.

Affects: new rows (tests S6, S7 and C dry10Pooled/wetHalfPooled) in wave1_results.csv and on the page; existing scores are unchanged. The ELF read cache and the observed-record cache are rebuilt once.

Technical details

Gap. S1-S5 score per-year totals (R/skillTests.R), B and C per-ELF totals; nothing sees location. The per-ELF dry10 (R/climateResponse.R) rests on about 4 years and its pooled row is the median of per-ELF ratios.

S6 ignition location (R/spatialTests.R). Per scored year with observed ignitions: mean negative log-likelihood per point under the run's ignition map normalised to sum 1 over the ELF, averaged over runs. N1: ignition points of all OTHER years, Gaussian kernel sd 25 km, mixed 90/10 with a uniform density; skill = skillScore() (1 - sum(lossModel)/sum(lossNull), as S1-S5). S7 burn location. Brier score of the share of runs that burned each cell of the burnable core (the area hindcastCore() gives), against the observed burned cells (polygons rasterized on the burn grid); N1 is the cell's burn frequency over the other years. AUC per year goes to calibration (measure auc, null NA, since it is the model's alone). ELF rows carry the 2.5-97.5% of single runs in lo/hi; pooled rows the usual bootstrap. N0 is not done.

Pooled driest years (climatePooledYears()). The dry/wet years come from climateYears(), split out of scoreClimateResponse(). Per ELF-year the simulated area is the median run. ratio (headline) = sum sim / sum obs: most wetter-half and some driest ELF-years have no fire in model and record, so medianRatio (exp of median log((sim+1)/(obs+1))) is exactly 1 there and cannot tell 2x from 0.5x. The interval is a cluster bootstrap over ELFs (999, 2.5-97.5%). wetHalf goes through the same code.

Adapter. readHindcastLocation() reduces each year as it reads (cells only, no stack of maps). observedRecord() now keeps each year's points; readerCallees and the file list (now .gpkg too) change, so the cache keys change. Page: new "Where fire happens" table, new "all: pooled ELF-years" row in the climate table. The page showed no S1-S5 skills before.

Real data, ELF 11.3, 39 years, 20 runs (GPSC, scratch/spatialTests): S6 skill natAgeIgn 0.026, natAgeISF 0.041 (the 20 runs share one map, so no run range). S7 skill (mean map) 0.054 vs 0.029; single runs alone are all below N1 (-0.97 to -0.29 and -1.43 to -0.24). S7 AUC median 0.501 vs 0.503 (chance). Pooled dry10 ratio over 18 common ELFs (72 ELF-years): natAgeIgn 0.60 (0.42-0.80), natAgeISF 0.51 (0.38-0.65).

Tests. Base (development): 667 expectations, 0 failed. Branch: 703, 0 failed, 0 skipped (OPENBLAS_NUM_THREADS=1). The 9 new tests in test-spatial.R all fail on the base. They cover matching map vs shuffled (S6, S7), leave-year-out nulls, skipped years, runner rows, a known pooled ratio and the page. Two existing tests changed their expected shape (climatePooled element, 4 more C rows).

Open PR #30 also edits climateResponse.R, the runner and the page; this branch is on development, so expect hunk conflicts to resolve in whichever merges second.

Reuses: scoredYears(), obsBy(), skillScore(), bootstrapSkill(), bootstrapMean() (AUC via the calibration path), quantRange(), withSeed(), sortableTable()/ratioCell() on the page, hindcastCore(), observedRecord(), the readerCallees cache path; new: scoreS6/scoreS7/ignitionYear (nothing scored location), climateYears (split from scoreClimateResponse, not a copy), climatePooledYears (nothing pools ELF-years; bootstrapPooled resamples years inside ELFs, which the request excludes), readHindcastLocation (adapter), locationPageRows.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Lx3DXhXsFis2pbqBTh2PPh

…d the pooled driest-years score

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Lx3DXhXsFis2pbqBTh2PPh
@eliotmcintire eliotmcintire added enhancement New feature or request backwards compatible Does not break existing behaviour labels Dec 1, 2026
eliotmcintire and others added 2 commits December 1, 2026 14:37
…unSkillRange call per ELF; one bindYears helper

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Lx3DXhXsFis2pbqBTh2PPh
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Lx3DXhXsFis2pbqBTh2PPh
@eliotmcintire
eliotmcintire merged commit 2fd1a3b into development Dec 1, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backwards compatible Does not break existing behaviour enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant