Skip to content

New parameter spreadLink: fit climate outside the maxAsymptote ceiling - #81

Merged
eliotmcintire merged 1 commit into
developmentfrom
feat/climate-outside-ceiling
Oct 18, 2026
Merged

eliotmcintire merged 1 commit into
developmentfrom
feat/climate-outside-ceiling

Conversation

@eliotmcintire

Copy link
Copy Markdown
Collaborator

Adds a switch that lets a spread fit put drought after the fuel-driven ceiling on spread probability instead of under it, so dry and wet years can differ in how far fires spread. Off by default; existing fits are untouched.

Affects: only runs that set spreadLink = "climateOutside"; the default fits, cache keys and ledger rows are bit-identical to today.

Depends-on: PredictiveEcology/fireSenseUtils#165

Technical details
  • New parameter spreadLink = c("ceiling", "climateOutside"), default "ceiling". With "climateOutside" the logistic and its maxAsymptote ceiling are fitted to the non-climate covariates and the climate term is added on the logit after it (fireSenseUtils::spreadProbFromCovs(climateRef =)), with the year effect yearSpreadSD on the same logit.
  • spreadFitPrep() computes sim$climateRef_spread once (fireSenseUtils::spreadClimateRef(): the mean of each climate covariate over the fit's pixel-years, on the design scale; new output) and stops if the formula has no climate covariate. It is passed wherever covCentre is: the fit (R/fitSpread.R), the threshold calibration's objective and gates (R/runSpreadWithoutDEoptim.R, estimateSNLLThresholdPostLargeFires()), the held-out simulation and the validation figures (spreadObjFunArgs()), with omitNullArgs() so keys are unchanged when it is NULL.
  • The ledger row (R/spreadFitLedgerRow.R) gets spreadLink and climateRef_spread (fireSenseUtils::spreadLinkTxt, spreadFitClimateRefTxt) only for such a fit, so fireSense_spreadPredict applies the same link; rows of the default link are unchanged.
  • objectiveBodies() now includes spreadProbFromCovs(), the link itself.
  • fireSenseUtils floor 0.2.3.9106.

Tests: tests/testthat/test-climateOutside.R (default leaves fit, row and keys as they were; the reference equals the hand-computed mean and what runDEoptim() receives; with an intercept it is 0; ledger and held-out rows record link and reference; cache keys omit it only when NULL; the calibration hands it to objective and gates; no climate covariate stops). Whole module suite: 830 pass.

🤖 Generated with Claude Code

https://claude.ai/code/session_014G18Mik3fH4z5M5CyMSUS6

spreadLink = "ceiling" (default) is the fit as it was, bit for bit, with the same
cache keys and ledger rows. "climateOutside" fits the logistic and its ceiling to
the non-climate covariates and adds the climate term on the logit after it
(fireSenseUtils::spreadProbFromCovs(climateRef =)). The climate reference is the
mean of each climate covariate over the fit's pixel-years
(fireSenseUtils::spreadClimateRef(); sim$climateRef_spread), found once in
spreadFitPrepare and given to the fit, the threshold calibration (objective and
gates), the held-out simulation, the validation figures and the ledger row,
which records it with the link (spreadFitClimateRefTxt, spreadLinkTxt). The
spread link's body joins the objective bodies in the fit's and the threshold's
cache keys. fireSenseUtils floor 0.2.3.9106.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014G18Mik3fH4z5M5CyMSUS6
@eliotmcintire eliotmcintire added enhancement New feature or request backwards compatible Existing code and results keep working unchanged labels Oct 18, 2026
@eliotmcintire
eliotmcintire merged commit 5380eb7 into development Oct 18, 2026
17 checks passed
@eliotmcintire
eliotmcintire deleted the feat/climate-outside-ceiling branch October 18, 2026 15:06
eliotmcintire added a commit that referenced this pull request Oct 18, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014G18Mik3fH4z5M5CyMSUS6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backwards compatible Existing code and results keep working unchanged enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant