Repository navigation
Spatial skill tests S6/S7 (ignition and burn location) and pooled driest-years score - #31
Merged
Merged
Conversation
…d the pooled driest-years score Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Lx3DXhXsFis2pbqBTh2PPh
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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) inwave1_results.csvand 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-ELFdry10(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 areahindcastCore()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 tocalibration(measureauc, null NA, since it is the model's alone). ELF rows carry the 2.5-97.5% of single runs inlo/hi; pooled rows the usual bootstrap. N0 is not done.Pooled driest years (
climatePooledYears()). The dry/wet years come fromclimateYears(), split out ofscoreClimateResponse(). 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, somedianRatio(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%).wetHalfgoes 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;readerCalleesand the file list (now.gpkgtoo) 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
ratioover 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 intest-spatial.Rall 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 (climatePooledelement, 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(), thereaderCalleescache path; new:scoreS6/scoreS7/ignitionYear(nothing scored location),climateYears(split fromscoreClimateResponse, not a copy),climatePooledYears(nothing pools ELF-years;bootstrapPooledresamples years inside ELFs, which the request excludes),readHindcastLocation(adapter),locationPageRows.🤖 Generated with Claude Code
https://claude.ai/code/session_01Lx3DXhXsFis2pbqBTh2PPh