Repository navigation
spreadClimate = "activation": fuel sets each pixel's spread ceiling, climate sets how much of it is reached - #255
Merged
Conversation
… is x spreadLinkInputs() gets a third branch, selected by activationIntercept: pc_i = f + (p50 - f) * plogis(eta_i) from the non-climate columns, x_i = activationIntercept + the climate term (spreadClimateSplit()), NA rows unburnable (unburnableLinkPars()). In the fit's parameters activationIntercept comes right before the random-effect sds and maxAsymptote is not fitted: splitSpreadPar() puts powerLawPc50 in its place, so the gates and saturation summary read p50 as the ceiling; with the activation they look at p. spreadRandomEffectArgs() sets the objective's fitActivationIntercept from the bounds; runDEoptim(), its re-score, spreadProbGates() and spreadFitValidationData() pass or infer it. checkLinkParams(activation =) requires powerLawSmooth at the floor. New constants spreadClimateTxt, spreadClimateOptions, activationInterceptTxt, spreadActivationInterceptBounds. Predictor and ceiling are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Lx3DXhXsFis2pbqBTh2PPh
eliotmcintire
added a commit
to PredictiveEcology/fireSense_spreadPredict
that referenced
this pull request
Nov 20, 2026
ledgerSpreadClimate() reads the row's mode (fireSenseUtils::spreadClimateTxt); a row without it is "ceiling" with climateRef_spread and a power-law link, else "predictor", as before. ledgerLinkArgs() passes spreadClimate = "activation" for such a row only; spreadProbOneELF() then takes activationIntercept out of the covariate coefficients and gives it to fireSenseUtils::spreadLinkInputs(), and stops when the set and the row disagree. ledgerLinkNumber() checks the activation's link with checkLinkParams(activation =). The per-pixel parameters go out through linkParsRas() as with the ceiling, so fireSense_burn 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
…eview fixes pcAtP50 (fireSense_spreadFit's powerLawPcAtP50) uses the activation's mechanism: maxAsymptote is not in the fitted parameters and splitSpreadPar() puts powerLawPc50 in its place. It is an explicit argument of .objfunSpreadFit(), runDEoptim() (to the fit and the re-score, out of the key when NULL), spreadProbGates() and spreadFitValidationData(). With powerLawPc50 given, the objective stops on an unnamed par of the wrong length (Fable review L6). activationDudYearShare() gives pnorm(-activationIntercept / yearSpreadSD) per set (H1); ledger constants spreadFitDudYearShareTxt and spreadFitPcAtP50Txt. runDEoptim()'s start-up message lists activationIntercept apart (L5). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Lx3DXhXsFis2pbqBTh2PPh
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## development #255 +/- ##
===============================================
+ Coverage 93.13% 93.27% +0.14%
===============================================
Files 68 68
Lines 5141 5204 +63
===============================================
+ Hits 4788 4854 +66
+ Misses 353 350 -3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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
AllenLarocque
pushed a commit
to AllenLarocque/fireSense_spreadFit
that referenced
this pull request
Nov 29, 2026
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds a third way for climate to enter the fire-spread model. Fuel sets how far each pixel can go, and a dry year moves every pixel toward its own limit by the same share, so the fuel contrast stays the same from wet to dry years, as the burned-area data show. The year-to-year random effect sits beside climate, not beside fuel.
Affects: nothing for existing fits; a fit made with
spreadClimate = "activation"(fireSense_spreadFit) uses the new form, and prediction applies it from the ledger row.Technical details
The gap:
spreadLinkInputs()(R/spreadProbGates.R:254-285on development) has one per-pixel form only, climate movingpc. Every place that readslogisticPars[1]as the ceiling (spreadLinkInputs()pc0 > p50stop,objFunSpread.R:818saturation summary,:911andspreadProbGates()gates,spreadFitValidation.R:268response plot) assumesmaxAsymptoteis fitted.The change:
spreadLinkInputs(activationIntercept =): a third branch.pc_i = f + (p50 - f) * plogis(eta_i)witheta_ithe non-climate columns (intercept included);x_i = activationIntercept + sum(beta_clim * (clim - climateRef)). NA rows are unburnable.spreadProbFromCovs()passes it through.activationIntercept(activationInterceptTxt) comes right after the covariate coefficients, before the random-effect sds;maxAsymptoteis not fitted.splitSpreadPar()takes the intercept out and putspowerLawPc50in themaxAsymptoteslot, unless a named set has one (a ledger row). So everylogisticPars[1]reader gets p50, which is the ceiling of every pixel in this mode, with no branch of its own. The gates and the saturation summary look atp, not atpat the reference climate.spreadRandomEffectArgs()sets the objective's newfitActivationInterceptfrom the bounds, as it doesfitYearSpreadSD. SorunDEoptim(), its re-score, its profile and simulated members, and the module's emulator get it.spreadProbGates()andspreadFitValidationData()find it by name. Without it the argument is NULL and left out of every cache key.checkLinkParams(activation =): the mode needs"powerLawSmooth"withlowerAsymptote = lowerSpreadProb. Below the floor the other forms fall faster for a higherpc, which would rank rich fuel below poor in wet years (review finding).spreadClimateTxt(ledger column"spreadClimate"),spreadClimateOptions,activationInterceptTxt,spreadActivationInterceptBounds(c(-10, 10)).Reuses:
spreadClimateSplit(),unburnableLinkPars(),linearLinkPars(),linearLinkProb(), the NA-row block and per-cellparsmatrix of the ceiling branch, the per-celllinkParspath toSpaDES.tools::spreadCpp()(objFunSpread.Rcrop matrix),fixLogisticPars(),logisticParamNames,spreadRandomEffectArgs()andcheckLinkParams()(both extended in place),omitNullArgs(); new: nothing beyond the branch and the constants (no existing function computes a fuel-setpc).Tests: new
tests/testthat/test-climateActivation.R. It checks that p per pixel equals the formula, that the ratio ofp - fbetween pixels is the same across climate, that p never exceeds p50, that NA rows are unburnable, that the objective's p equalsspreadProbFromCovs()(what fireSense_spreadPredict calls) and its gates and summary use p and p50, the whole-landscape path, the validation and response plot,runDEoptim()keys, and a frozen-value regression of "predictor" and "ceiling". On the base the new file fails (10 failing tests; its frozen-value test passes there). Base vs branch,identical()on 20 outputs of predictor and ceiling (p, link inputs, gates, seeded buffered and whole-landscape objective simulations): all identical.Full suite (
devtools::load_all()+testthat::test_dir()): branch (on 0.2.3.9182) 833 tests, 0 failed, 3 skipped, 3464 expectations; the same branch before #253 merged, 829 tests, 0 failed, against base 970e7b5 818 tests, 0 failed, 3 skipped, 3305 expectations.R CMD check --no-manual(scratch library): 0 errors, 0 warnings, 2 notes, neither from this change (.gitof the worktree; data.tablesum(s)inobjFunInner(),objFunSpread.R:1141on development).Modules: PredictiveEcology/fireSense_spreadFit#142 and PredictiveEcology/fireSense_spreadPredict#51, with floor
>= 0.2.3.9183(this PR merging next, after the 0.2.3.9182 bump). fireSense_burn needs no change: it reads the per-cell parameters and adds the year draw to x.Second commit (powerLawPcAtP50 and the Fable review of these PRs):
pcAtP50 = TRUE(new argument of.objfunSpreadFit(),runDEoptim(),spreadProbGates(),spreadFitValidationData()): p_c fixed at p50 in any mode, by the activation's mechanism.maxAsymptoteis left out of the fitted parameters andsplitSpreadPar()putspowerLawPc50in its place, so no bound has zero width; Add powerLawPcAtP50: fix p_c at the calibrated p50 fireSense_spreadFit#141's equal bounds give NaN in the emulator'semulatorSpace(). NULL is left out of calls and keys.powerLawPc50given, the objective stops on an unnamedparwhose length does not match the formula and link (review L6). WithoutpowerLawPc50there is no check: 13 existing tests pass other layouts there.activationDudYearShare():pnorm(-activationIntercept / yearSpreadSD)per set, 0 (or 1 for a negative intercept) without a year effect (review H1). New ledger constantsspreadFitDudYearShareTxt,spreadFitPcAtP50Txt.runDEoptim()'s start-up message listsactivationInterceptapart from the logistic parameters (L5).Reuses (second commit):
splitSpreadPar(),fixedLogisticPars,logisticParamNames,omitNullArgs(); new:activationDudYearShare()(nothing computed the dud-year share).Full suite after the second commit: 838 tests, 0 failed, 3 skipped, 3487 expectations. R CMD check: 0 errors, 0 warnings, the same 2 notes.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Lx3DXhXsFis2pbqBTh2PPh