Repository navigation
Predict with fuel x climate interaction coefficients - #43
Merged
Merged
Conversation
…roduct of its covariates 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
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.
A fitted spread model that has fuel x climate terms can now be used to predict fire spread. The prediction multiplies the fuel and the climate the same way the fit did.
Affects: nothing for existing fits; fits made with fuel x climate terms predict with them.
Depends-on: PredictiveEcology/fireSenseUtils#242
Technical details
Gap.
spreadProbOneELF()required a covariate column for every fitted coefficient name (fireSense_spreadPredict.R:525) and selected exactly those columns (:537), so a coefficientCMD:dom_agb_Pice_marstopped with "no covariate".Fix. It needs the data columns of the fitted terms (
fireSenseUtils::spreadSourceCols(): the main covariates and the covariates an interaction multiplies), and passes the fitted terms as the design columns (:550).fireSenseUtils::spreadProbFromIntegerCovs(), which the fit uses, forms the product after each covariate is rescaled and centred with the row'scovCentre_spread, 0 whereyoungAgecleared the fuel,. So the linear predictor is the fit's. A row without interactions takes the same path as before (tested: the existing suite is unchanged).Reuses:
fireSenseUtils::spreadSourceCols(),spreadProbFromIntegerCovs(),spreadProbFromCovs(),youngAgeExclusiveCols(); new: nothing (a 4-line change inspreadProbOneELF()).Tests. New
tests/testthat/test-spreadInteractions.R: prediction equals the hand-built linear predictor; with an intercept and a centre that includes the interaction; a missing covariate stops naming it; a parity test computes the fit's spread probability for the same covariates withfireSenseUtils::spreadProbFromIntegerCovs()+spreadProbFromCovs()(fuel logged, cleared whereyoungAgeis 1, interaction cleared too) and requires the prediction to equal it. On base the file has 3 errors; full suite (convertToPackage()+test_local()): branch 0 failures, 0 errors, 0 skipped, 358 passed; base 0 / 0 / 0 / 350. Scratch library only.Floors: the
reqdPkgsfloor on fireSenseUtils is raised after PredictiveEcology/fireSenseUtils#242 merges and is bumped.🤖 Generated with Claude Code
https://claude.ai/code/session_014G18Mik3fH4z5M5CyMSUS6