Repository navigation
In-sample hindcasts: no S7; new S8 (size given escape) and S9 (shape given escape) - #33
Conversation
…given escape) S7's whole-ELF AUC is about 0.9 in a hindcast that spreads the observed escapes, only because the fires start where the observed ones did. It is no longer scored for such runs. S8 and S9 score what a fire does once it has escaped: its final size and its shape around its start. A run is detected as in-sample from fireSense_burnSummary.csv (every run starts the same fires). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Lx3DXhXsFis2pbqBTh2PPh
|
Real-data check (GPSC, read-only; 39 years, 20 runs; all four ELFs detected as in-sample; every seeded start fell in an observed polygon). Range is the 2.5-97.5% of single runs; pooled range is the bootstrap.
The S9 ELF value ranks cells by the share of 20 runs, so it sits above the single-run range (one run is a 0/1 map). The S8 ELF rho uses the median over runs of each fire's size, so it is also above the single-run range. Files: |
…, distance-only baseline for S9 pageRowsOf/resultCell serve the location and escape tables; longRows takes nUnits; readHindcastSetFiles and rasterizedValues are used by the sim, starts, location and seeded readers. S9 reports the AUC of a distance-only score (closer to the start is likelier burned) and the model's AUC minus it as the headline. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Lx3DXhXsFis2pbqBTh2PPh
|
Update after review: S9 now has a distance-only baseline (each cell of the circle scored by minus its distance to the start, same AUC). Headline
Read with care: the 0.94 uses the share of 20 runs per cell. A single run's own map scores 0.62-0.74, which is about the distance-only 0.63-0.68, so the single-run difference is near 0 (11.4 slightly below). Most of the model's 0.25 gain over distance comes from averaging the runs, not from any one run's shape. |
Some hindcasts spread the fires that were actually observed, from their real start points. For those runs the old "where fire happens" score for burned cells looked good (AUC about 0.9) only because the fires start in the right place. This PR stops scoring that for those runs and adds two scores of what a fire does once it has escaped: how big it gets, and what shape it takes.
Affects: scores of in-sample (observed-escape) hindcasts only: S7 rows disappear for them, and S8 and S9 rows and a "Given an escape" table appear. Normal runs are unchanged.
Technical details
Defect.
R/spatialTests.RscoreS7scored every ELF withlocation$burn, including runs that seed the observed escapes (FS_HC_IGNITIONS=observedEscapes), where the whole-ELF AUC only shows that fires start where the observed ones did.In-sample detection. The hindcast files record no setting; only the folder name (
_obsEsc) and the run name carry it. So it is read from the data (hindcastInSample()): in every year with a fire, every run starts the same fires from the same cells (igLocoffireSense_burnSummary.csv), with at least two runs.readFireSenseHindcast()has a new argumentinSample(defaultNA: detect;TRUE/FALSEoverride) and putsinSampleandlocation$seededin the ELF input.scoreS7returnsNULLwhenelf$inSampleis true.Linking fires to escapes.
fireSense_burnSummary.csvhas one row per fire, in the order offire_idinhindcast_sizes.csvand of the values of that rep'shindcast_burnID_rep*.tif; the rep comes fromtimeinhindcast_reps.csv. The sizes of the two files are compared, and the read stops if they differ. The start cell isigLoc. The start is tied to the observed polygon ofhindcast_observedPolys.gpkgthat holds it (starts in no polygon are dropped with a message; none were on the real data). Observed size is the polygon rasterized on the burnable cells (core and buffer), which reproduceshindcast_observedSizes.csvon 11.3 / 2000.S8 (
R/escapeTests.R): per seeded fire, median over runs of the final size against the observed size. Per ELFrho(Spearman),log2ratio(median log2 of simulated over observed, as inbias.R) andnFires; the range is the 2.5-97.5% of single runs. Pooled withbootstrapPooled()(median over ELFs, bootstrap over ELFs and fires).S9: per fire with N observed scored cells, the circle around its start holding the 2N nearest scored cells (
circleCells()); positives are the fire's cells in it, negatives the rest; each cell scored by the share of runs that burned it;aucOf(). Baseline: each cell of the circle scored by minus its distance to the start, same AUC (aucDist); the headline isaucDiff, the model's AUC minus it. Per ELF the median over fires (range: median over fires of each single run's 0/1 map),shareInside(share of the fire's cells inside the circle) andnFires. Not scored for normal runs: their fires start elsewhere than the observed ones, so the circle is not defined.Page. New sortable "Given an escape" table, hidden when there are no S8/S9 rows.
wave1_results.csvgets testsS8andS9.Reuses:
aucOf,longRows(newnUnitsargument; callers unchanged),bootstrapPooled,quantRange,ratioCell,gridXY,scoredYears,hindcastFlammable,readHindcastLocation(now also returnsgridandgridCell), the ELF tagging idiom inrunWave1. Lifted out of existing code and used by old and new callers:pageRowsOf/resultCell(fromlocationPageRows; the location and escape tables use them),hindcastSet/hindcastRun,readHindcastSetFiles(sim and starts readers),rasterizedValues(location and seeded readers),gridOf,toScoredIndex,rankCor(frombootstrapRankDiff). Not changed:scoreRankingstill callscoritself, becauserankCorreturns NA for fewer than 3 pairs and drops NA pairs, so the behaviour would differ. New:scoreS8,scoreS9,circleCells/sqDist(nothing picks the k nearest cells to a point),escapeResultRows,escapePageRows,readHindcastStarts,hindcastInSample,readHindcastSeeded(nothing read the burn summary's start cells).Tests. New
tests/testthat/test-escapes.R(12 tests): perfect size model gives rho 1 and log ratio 0, shuffled gives rho near 0; the circle holds exactly 2N cells; perfect shape gives AUC 1, random about 0.5; elongated fire reports its share inside; S7 absent for in-sample and present for normal; pooled rows; page rows; reader detection and link. Ondevelopment: all new tests error (functions missing); full suite 142 tests, 0 failures. On this branch: full suite 154 tests, 0 failures, 0 skipped (OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1,testthat::test_dir).Real data (GPSC, read-only;
score_ClimBaseline_20261125_obsEscand_obsEsc_yeDraw, ELFs 6.6.2, 11.3, 11.4, 14.3, 39 years, 20 runs, all detected in-sample): pooled S8 rho 0.24 / 0.23, pooled S9 AUC 0.94, distance-only AUC 0.66, difference 0.25-0.26; per ELF numbers are in the PR comment.🤖 Generated with Claude Code
https://claude.ai/code/session_01Lx3DXhXsFis2pbqBTh2PPh