Repository navigation
spreadCovariates: add "fuel" and "climate" - #116
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Lx3DXhXsFis2pbqBTh2PPh
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Lx3DXhXsFis2pbqBTh2PPh
eliotmcintire
added a commit
that referenced
this pull request
Nov 21, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Lx3DXhXsFis2pbqBTh2PPh
eliotmcintire
added a commit
that referenced
this pull request
Nov 21, 2026
…limateSplit 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.
spreadCovariatescan now fit spread with fuel only or climate only, beside all covariates and none. That lets us split how much of spread-fit quality comes from fuel and how much from climate.Affects: nothing by default (
"all"is unchanged); a run that setsspreadCovariates = "fuel"or"climate"fits and hindcasts a spread formula with only that group.Technical details
Gap:
spreadRHS()(R/spreadFormula.R) knew only "all" and "none";checkSpreadCovariates()rejected anything else.Fix:
spreadRHS()leaves out the youngAge/fuel/non-forest terms for "climate" and the climate term(s) for "fuel".youngAgeand non-forest classes go with fuel (vegetation state); say if you want them elsewhere. Formulas on a toy fit with CMD: all~ 1 + CMD + youngAge + fuelA, none~ 1, climate~ 1 + CMD, fuel~ 1 + youngAge + fuelA. Covariate tables are still made, as with "none".Interactions and other options:
spreadInteractions = "climate:fuel"stops with "fuel" and "climate" (checkSpreadInteractions()), naming what is missing.spreadCovariates(as for "none"), and spreadPredict uses the fitted ledger terms, so spreadPredict, dataPrepPredict and fireSenseUtils need no change.climateOutsideandactivationwork. "fuel" has none, andfireSense_spreadFitalready stops there with a clear message (spreadClimateCols()check beforespreadClimateRef()); dataPrepFit does not read spreadFit parameters, so nothing is added here.spreadClimateSplit(New parameter spreadClimateSplit: the spread climate as a between-year and a within-year term #108, open): not depended on; its split applies to the climate terms, which "climate" keeps and "fuel" drops.Reuses:
spreadRHS()/checkSpreadCovariates()/checkSpreadInteractions()extended in place,spreadFormula(),fireSenseUtils::youngAgeTxt, the existing "none" path and the new-value listspreadCovariatesValues(one place, also used in the error text); new: none (no new function).Tests (testthat-module, 1 thread): branch 564 passed, 0 failed, 1 skipped (the equivalence test needs
DPF_EQUIVALENCE_FIXTURE); base with the new tests copied in: 10 failed, 1 error (the new tests), 551 passed.🤖 Generated with Claude Code
https://claude.ai/code/session_01Lx3DXhXsFis2pbqBTh2PPh