Skip to content

Add the "powerLaw" spread link - #83

Merged
eliotmcintire merged 1 commit into
developmentfrom
powerlaw-link
Oct 19, 2026
Merged

eliotmcintire merged 1 commit into
developmentfrom
powerlaw-link

Conversation

@eliotmcintire

Copy link
Copy Markdown
Collaborator

Lets a spread fit use the new power-law link, in which a year's random effect cannot push fires past the percolation threshold. It is off by default.

Affects: Nothing changes unless spreadLink = "powerLaw" is set; the default fit, ledger row and cache keys are as before.

Depends-on: PredictiveEcology/fireSenseUtils#167

Technical details

spreadLink took only "ceiling" and "climateOutside" (fireSense_spreadFit.R:117) and was not validated. It now also takes "powerLaw", with a new parameter powerLawGamma (default fireSenseUtils::spreadPowerLawGamma, 1.9, fixed, not fitted). The link handed to the objective comes from spreadLink(P(sim)) (R/fitSpread.R), powerLawGamma goes to runDEoptim(), runSpreadWithoutDEoptim() (objective and gates), the held-out simulation and the validation; spreadFitLedgerRow() writes spreadLink and powerLawGamma_spread so fireSense_spreadPredict applies the same link. p_c (maxAsymptote) is bounded by fireSenseUtils::spreadPowerLawPcBounds, 0.14 to 0.276 (just above spreadProbFloor, up to the usual ceiling, above the percolation threshold of about 0.25); the covariates' bounds are unchanged (sign only). An unknown spreadLink, "powerLaw" with link = "logistic3pUpper", or a bad powerLawGamma stops. powerLawGamma is left out of the fit's and the threshold's cache keys unless the link is "powerLaw"; objectiveBodies() now also holds logisticAll() and powerLawLink(), so the first run after the update re-runs a cached fit.

Tests: new test-powerLaw.R (bounds, link and gamma to the fit, threshold and held-out simulation, ledger row, validation, cache-key omission); the toy-fit helpers of test-climateOutside.R moved to helper-spreadLink.R. Module suite (convertToPackage, test_local, scratch library with fireSenseUtils from that PR, locally numbered 0.2.3.9107): 878 pass, 0 fail on this branch; 830 pass, 0 fail on development, where the new test file errors at its first line (no spreadFitPowerLawGammaTxt). reqdPkgs floor is fireSenseUtils@development (>= 0.2.3.9107); no version bump.

🤖 Generated with Claude Code

https://claude.ai/code/session_014G18Mik3fH4z5M5CyMSUS6

fireSense_spreadFit: spreadLink = "powerLaw", powerLawGamma, p_c bounds, ledger columns.
fireSense_spreadPredict: reads the row's link and gamma and applies powerLawLink via spreadProbFromCovs.
Floor fireSenseUtils (>= 0.2.3.9107).

Co-Authored-By: Claude Opus 5.5 <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 19, 2026
@eliotmcintire
eliotmcintire merged commit 1af872a into development Oct 19, 2026
9 checks passed
@eliotmcintire
eliotmcintire deleted the powerlaw-link branch October 19, 2026 00:42
eliotmcintire added a commit that referenced this pull request Oct 19, 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