Repository navigation
New parameter spreadInteractions: fuel x climate terms in the spread formula - #107
Merged
Merged
Conversation
…terms to the spread formula Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014G18Mik3fH4z5M5CyMSUS6
…ared the fuel Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014G18Mik3fH4z5M5CyMSUS6
This was referenced Nov 17, 2026
Open
eliotmcintire
added a commit
that referenced
this pull request
Nov 17, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014G18Mik3fH4z5M5CyMSUS6
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.
The fire spread model can now be fitted with terms that multiply each fuel by the climate, so the effect of fuel can change with how dry the year is. This adds a setting that turns those terms on. It is off by default, so nothing changes unless it is set.
Affects: nothing by default; with the new setting on, the spread model has one extra coefficient per fuel class.
Depends-on: PredictiveEcology/fireSenseUtils#242
Technical details
Gap. The spread formula was built as
~ 1 + climate + youngAge + fuel...with no way to add terms (fireSense_dataPrepFit.R:1059,R/spreadFormula.R).Fix. New parameter
spreadInteractions(character, defaultcharacter(0))."climate:fuel"addsclimate:fuelfor each spread climate variable and each fuel covariate (fireSenseUtils::spreadFuelCols(): notyoungAge,nfLCC_*ortreedWetland) after the main effects. The RHS is built in newspreadRHS()(the code that was inline at:1059, moved unchanged);Init()calls newcheckSpreadInteractions()(stops on any other value, and withspreadCovariates = "none"). With the default the formula string is byte-identical (tested against the old inline expression). The products are made in fireSenseUtils (spreadProbFromIntegerCovs()) from the rescaled, centred covariates, 0 whereyoungAgecleared the fuel, in the fit and in prediction; each main effect is then the slope at the mean of the other covariate.fireSenseUtils::spreadFuelColsis added toprepSpreadFitData's.cacheExtra(a test requires every package function the event reaches to be listed), which re-runs that event once; the floor bump below does the same.Reuses:
spreadFormula(),checkSpreadCovariates()as the model for the check,fireSenseUtils::spreadFuelCols()/spreadIndicatorCols(),fireSenseUtils::youngAgeTxt; new:spreadRHS()(the inline RHS expression moved so it is tested alone and takes the interaction terms),checkSpreadInteractions()(a check of the new parameter; nothing checks it).Tests. New
tests/testthat/test-spreadInteractions.R; theprepare_SpreadFit()formula helper fromtest-spreadIntercept.Rmoved tohelper-formulaFor.Rso both use it. Default string byte-identical, interactions per climate variable and fuel (indicators andyoungAgeexcluded, emptied fuels dropped), parameter defined and checked. On base the new tests fail (6 failures, 3 errors); full suite (convertToPackage()+test_local()): branch 0 failures, 0 errors, 1 skipped, 537 passed; base 0 / 0 / 1 / 524. Scratch library only.Floors: the
reqdPkgsfloor on fireSenseUtils is raised after PredictiveEcology/fireSenseUtils#242 merges and is bumped. The samespreadInteractionsvalue is needed by the matchingfireSense_spreadFitandfireSense_spreadPredictPRs (branchspreadInteractions).🤖 Generated with Claude Code
https://claude.ai/code/session_014G18Mik3fH4z5M5CyMSUS6