Skip to content

spreadClimate = "activation": fuel sets each pixel's ceiling, climate is fitted with its own intercept - #142

Merged
eliotmcintire merged 2 commits into
developmentfrom
feat/climateActivation
Nov 20, 2026
Merged

eliotmcintire merged 2 commits into
developmentfrom
feat/climateActivation

Conversation

@eliotmcintire

@eliotmcintire eliotmcintire commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

This lets a spread fit use the new "activation" form: fuel sets how far each pixel can spread at most, and climate decides how much of that is reached in a given year. The fit then estimates a climate intercept instead of a single spread ceiling. The ledger row says which form it used, so prediction applies the same one.

Affects: nothing for fits with spreadClimate = "predictor" or "ceiling"; spreadClimate = "activation" is a new option.

Depends-on: PredictiveEcology/fireSenseUtils#255

Technical details

The gap: spreadClimate accepts only "predictor" and "ceiling" (R/fitSpread.R:293), the bounds always fit maxAsymptote (fireSense_spreadFit.R:1233), and a ceiling row and an activation row would look the same in the ledger (R/spreadFitLedgerRow.R:39-43).

The change:

  • spreadClimate = "activation": checkSpreadLink() accepts it and checks its link with fireSenseUtils::checkLinkParams(activation = TRUE) ("powerLawSmooth", lowerAsymptote at the floor). It gets climateRef_spread and p50 like "ceiling" (climateAsReference(), spreadPowerLawPc50(), so spreadLinkArgs() carries p50 to the fit, the gates, the debug call and the validation figures).
  • Bounds: maxAsymptoteBoundsOf(activation = TRUE) is NULL, so estimateSpreadParams() leaves maxAsymptote out; it adds activationIntercept after the formula terms, before the sds, from the new parameter activationInterceptBounds (default fireSenseUtils::spreadActivationInterceptBounds, c(-10, 10)). The objective learns the mode from the bounds (fireSenseUtils::spreadRandomEffectArgs()), so the emulator path needs nothing new.
  • Ledger row: addFixedParsToLedger(maxAsymptote =) puts p50 first, where the objective uses it (fixedMaxAsymptote()), so the row's params have the usual shape. A fit with spreadClimate other than "predictor" writes it (fireSenseUtils::spreadClimateTxt). A "predictor" row is unchanged, as test-climateOutside.R requires.
  • reqdPkgs: fireSenseUtils@development (>= 0.2.3.9183).

Reuses: isCeiling(), climateAsReference(), spreadPowerLawPc50(), spreadLinkArgs(), maxAsymptoteBoundsOf(), estimateSpreadParams(), addFixedParsToLedger(), checkSpreadLink(), spreadFitLedgerRow() (each extended in place), fireSenseUtils::checkLinkParams(), spreadRandomEffectArgs(), spreadClimateOptions, logisticParamNames; new: isActivation(), activationInterceptBoundsOf(), fixedMaxAsymptote() (one-line accessors beside isCeiling(); nothing existing names the mode or its bounds).

Tests: new tests/testthat/test-climateActivation.R: the bounds (no maxAsymptote, activationIntercept before yearSpreadSD, its own bounds), the ledger row (mode, p50 as maxAsymptote, the intercept), "predictor" and "ceiling" unchanged, the link and climate-covariate stops, addFixedParsToLedger(), and p50 reaching the gates and validation figures. The metadata tests list the new parameter. On the base module the new file fails: all 6 tests (10 failures and errors). Full suite (SpaDES.core::convertToPackage() + testthat::test_local(), as the shared workflow): branch 297 tests, 0 failed, 0 skipped, 1368 expectations; base 291 tests, 0 failed, 0 skipped, 1330 expectations.

FireSenseTesting wiring for an arm: FS_SPREAD_CLIMATE = "activation" already reaches spreadClimate; the arm is lp05 + FS_SPREAD_CLIMATE = "activation" + FS_SPREAD_SD_BOUNDS = "0,1".

Second commit:

  • powerLawPcAtP50 (parameter, stop conditions and tests from Add powerLawPcAtP50: fix p_c at the calibrated p50 #141, minus its equal-bounds DEoptim test): maxAsymptoteBoundsOf(pcAtP50 = TRUE) leaves maxAsymptote out, as for the activation, and still checks p50 against the outer limits. spreadLinkArgs() gives the objective pcAtP50 = TRUE and p50; the ledger row has p50 as maxAsymptote and pcAtP50_spread = TRUE. A test runs the emulator start on these bounds: finite unit cube, pcAtP50 in its objective arguments, a population in bounds. The same test shows equal bounds give NaN.
  • Activation (Fable review): the formula intercept, inside plogis(), gets the new activationFuelInterceptBounds (default c(-6, 6); M2). The fit reports each set's dud-year share, and an activation row stores it (dudYearShare_spread; H1). activationIntercept keeps c(-10, 10).
  • Not changed: L3 here. The fit has no lowerSpreadProb parameter; the objective uses spreadProbFloor, which is already checkLinkParams()'s default floor.

Reuses (second commit): maxAsymptoteBoundsOf(), estimateSpreadParams(), spreadLinkArgs(), spreadPowerLawPc50(), fixedMaxAsymptote(), spreadFitLedgerRow() (extended), fireSenseUtils::powerLawPcBounds(), activationDudYearShare(), emulatorSpace(), emulateObjective(); new: pcAtP50() (one-line accessor beside isActivation()).

Full suite after the second commit, against PredictiveEcology/fireSenseUtils#255 installed at 0.2.3.9183: 303 tests, 0 failed, 0 skipped, 1403 expectations (base 291 tests, 0 failed).

🤖 Generated with Claude Code

https://claude.ai/code/session_01Lx3DXhXsFis2pbqBTh2PPh

With spreadClimate = "activation" fuel sets each pixel's ceiling below p50 and
climate is the linear predictor (fireSenseUtils::spreadLinkInputs()). The bounds
leave out maxAsymptote (maxAsymptoteBoundsOf(activation =)) and add
activationIntercept after the covariates (new parameter
activationInterceptBounds, default fireSenseUtils::spreadActivationInterceptBounds).
The fit gets climateRef and p50 as the ceiling mode does (climateAsReference(),
spreadPowerLawPc50()); checkSpreadLink() accepts the mode and checks its link
with fireSenseUtils::checkLinkParams(activation =). The ledger row gets p50 as
maxAsymptote (addFixedParsToLedger(maxAsymptote =)) and, for a mode other than
"predictor", its spreadClimate (fireSenseUtils::spreadClimateTxt); a "predictor"
row is unchanged. Floor fireSenseUtils >= 0.2.3.9183
(PredictiveEcology/fireSenseUtils#255).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Lx3DXhXsFis2pbqBTh2PPh
…ixes

powerLawPcAtP50 (from #141, without its equal bounds): maxAsymptoteBoundsOf()
returns NULL for it as for the activation (still checking p50), spreadLinkArgs()
gives the objective pcAtP50 = TRUE and p50, the ledger row has p50 as
maxAsymptote and pcAtP50_spread = TRUE. Equal bounds gave the emulator start a
zero-width dimension (NaN in emulatorSpace()); a test runs the emulator on the
new bounds. Stops with the ceiling or a non-power-law link, as #141.
Activation (Fable review): the formula intercept is bounded by the new
activationFuelInterceptBounds, c(-6, 6) (M2); the fit reports, and an
activation row stores, each set's dud-year share (H1).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Lx3DXhXsFis2pbqBTh2PPh
@eliotmcintire
eliotmcintire merged commit 2bdbbf0 into development Nov 20, 2026
9 checks passed
@eliotmcintire
eliotmcintire deleted the feat/climateActivation branch November 20, 2026 13:25
eliotmcintire added a commit that referenced this pull request Nov 20, 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