Skip to content

Spread fuel effect: change in spread probability per fuel, for the ELF map - #260

Merged
eliotmcintire merged 5 commits into
developmentfrom
spreadFuelEffect
Nov 23, 2026
Merged

eliotmcintire merged 5 commits into
developmentfrom
spreadFuelEffect

Conversation

@eliotmcintire

@eliotmcintire eliotmcintire commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

The raw fuel coefficients on the ELF map run from about 2 to 80 and cannot be compared between species. This adds a comparable number for each fuel: how much the chance of fire spread changes when that fuel goes from absent to its typical amount.

Affects: adds a "Spread fuel effect" group (spreadEffect_<fuel>, probability) to the ELF map features. It is empty for every ELF until a spread fit is rerun with the matching fireSense_spreadFit change, because older ledger rows lack the fit-data summary. No existing ledger column or result changes.

Technical details

Defect: no function turns a fuel coefficient into an effect. The covariate is class biomass over 1e4 (0 outside the class), classes differ hugely in biomass, the power-law link saturates and correlated classes trade off, so coefficients are not comparable (R/elfFeatures.R returned only the raw mean coefficient).

Fix:

  • spreadFuelEffect(row) (new R/spreadFuelEffect.R; one row per scenario of source columns, the interactions made by spreadAddInteractions() as in the fit, youngAge 0 in both scenarios): per fuel term of a ledger row, the change in spread probability from 0 to the term's median non-zero value, all other covariates at their centres (covCentre_spread), through the row's link, averaged over the row's parameter sets. A fit at its ceiling gives about 0.
  • spreadCovStats() (R/spreadProbGates.R): in one pass over the years, the centres (spreadCovCentre() is now a wrapper) and the median non-zero value and sd of the fuel covariates. The year loop of spreadCovMeans() became eachSpreadYearCovs(), shared by both.
  • New constants spreadFitCovMedianNonZeroTxt (covMedianNonZero_spread) and spreadFitCovSDTxt (covSD_spread).
  • elfFuelEffects() and elfFeatures(): one spreadEffect_<coefficient> feature per species, in group "Spread fuel effect", with the same per-ELF note as the coefficients. A row without the summary gives NA and the note "no fit-data summary" (no feature).
  • The model-form check shared by elfSpreadCoefs() and elfFuelEffects() is .modelForm() / .paramMeans().

Reuses: ledger*() readers (moved here), spreadProbFromCovs() (the one link evaluation, also behind fireSense_spreadPredict's spreadProbOneELF(), which is in a module and cannot be called from here), spreadCovMeans() loop, spreadDesignCols()/spreadSourceCols(), logisticParamNames, the link and ledger column constants, .fuelTermsBySpecies(), elfCoefLabel(); new: spreadFuelEffect()/spreadFuelTerms() (no function maps a ledger row to a probability change), spreadCovStats() (no function gives a median non-zero value or sd), elfFuelEffects().

The ledger-row readers (ledger*(), R/ledgerRow.R) moved here unchanged from fireSense_spreadPredict (PredictiveEcology/fireSense_spreadPredict#52), and spreadFuelEffect() calls them, so no row-reading code is repeated. 3 tests added (test-ledgerRow.R); full suite on the branch is now 897 tests, 0 failed, 0 errors, 10 skipped.

Tests (test-spreadFuelEffect.R, 9 new): known change in p for the logistic and power-law links, averaging over sets, saturation (intercept 30, coefficient 80: change under 1e-6), no-summary rows, spreadCovStats() by hand, elfFuelEffects() per species, elfFeatures() group/label/units. Full suite on the branch: 892 tests, 0 failed, 0 errors, 10 skipped. On base (development with the new test file): 9 errors, all in the new file, everything else passes. R CMD check --no-manual (scratch library): 0 errors, 0 warnings, 1 note (objFunInner: no visible binding for 's', already on development). checkDocFiles and codoc are clean.

No fit data is on disk: ELF ledgers hold parameters only, and the spread covariate tables exist only inside hash-keyed Cache entries that carry no ELF or ledger-row link, so rows without the new columns give NA.

Version note: fireSenseUtils#261 is merged and development is 0.2.3.9190, so #260 becomes 0.2.3.9191 when merged. The floors in fireSense_spreadFit#144 and fireSense_spreadPredict#52 name 9191 as a placeholder until then.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Lx3DXhXsFis2pbqBTh2PPh

… in spread probability a fuel makes, comparable between fuels

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Lx3DXhXsFis2pbqBTh2PPh
@eliotmcintire eliotmcintire added the enhancement New feature or request label Nov 23, 2026
@codecov

codecov Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.82353% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 93.74%. Comparing base (20788df) to head (651c9e3).
⚠️ Report is 2 commits behind head on development.

Files with missing lines Patch % Lines
R/ledgerRow.R 98.46% 1 Missing ⚠️
R/spreadFuelEffect.R 97.56% 1 Missing ⚠️
Additional details and impacted files
@@               Coverage Diff               @@
##           development     #260      +/-   ##
===============================================
+ Coverage        93.61%   93.74%   +0.13%     
===============================================
  Files               73       75       +2     
  Lines             5466     5614     +148     
===============================================
+ Hits              5117     5263     +146     
- Misses             349      351       +2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

…; spreadFuelEffect() calls them

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Lx3DXhXsFis2pbqBTh2PPh
eliotmcintire and others added 3 commits November 22, 2026 20:42
…spreadCovStats(): centre and fuel summary in one pass; elfCoefLabel uses the fuel prefix regex

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
…ffect, different-model effects

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Lx3DXhXsFis2pbqBTh2PPh
@eliotmcintire
eliotmcintire merged commit a631587 into development Nov 23, 2026
16 checks passed
@eliotmcintire
eliotmcintire deleted the spreadFuelEffect branch November 23, 2026 04:46
eliotmcintire added a commit that referenced this pull request Nov 23, 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

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant