Repository navigation
New parameter spreadCovariates: "none" gives the null spread formula ~ 1 - #104
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014G18Mik3fH4z5M5CyMSUS6
…bs carry it; metadata test lists it Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014G18Mik3fH4z5M5CyMSUS6
eliotmcintire
added a commit
that referenced
this pull request
Nov 16, 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.
This adds a switch to prepare a spread fit with no covariates, only an intercept. That "null" model is the baseline that fits with covariates have to beat.
Depends-on: PredictiveEcology/fireSenseUtils#236
Affects: nothing by default. With the new setting, the spread formula is
~ 1.Technical details
New parameter
spreadCovariates("all"default,"none"). The formula is built inprepare_SpreadFit()(fireSense_dataPrepFit.R~line 1045,spreadFormula(RHS, Par$spreadIntercept)): with"none"the RHS is empty andspreadFormula()(R/spreadFormula.R) returns"~ 1". With"all"the strings are byte-identical to before (~ 0 + ...,~ 1 + ...), so cache keys that hold the formula do not move.Init()calls the newcheckSpreadCovariates(), which stops on a value other than"all"/"none"and on"none"withspreadIntercept = FALSE.The covariate tables are still built under
"none": spreadFit derives its ranges from them, and the hindcast and ignition steps need the climate tables. Only the formula changes. A hindcast of a null fit must setspreadCovariates = "none"too (.globals); a hindcast that reuses a null ledger row and still prepares spread covariates would otherwise build a formula with covariates.Reuses:
spreadFormula()(generalised in place for an empty RHS),fireSenseUtils::spreadDesignCols()in the test, the formula-building statements oftest-spreadFormulaYoungAgeOnce.R; new:checkSpreadCovariates()(nothing validates a spread parameter combination; it is the one place for both checks).Tests (
test-spreadIntercept.R):spreadFormula(character(), TRUE)is"~ 1",checkSpreadCovariates()cases, the parameter and its default, andprepare_SpreadFit()'s formula for"none"/"all"with and without intercept. They fail on the base (no such function or parameter). Test stubs that runInit()now carry the parameter;test-metadata.Rlists it. Full suite (convertToPackage()+test_local()): branch 0 failed, 0 errors, 1 skipped, 514 passed; base 0 failed, 0 errors, 1 skipped, 497 passed (the skip is the opt-inDPF_EQUIVALENCE_FIXTUREtest, which needs a real study area and Drive; same on both). Libraries: the FireSenseTesting dev library read-only; nothing installed.🤖 Generated with Claude Code
https://claude.ai/code/session_014G18Mik3fH4z5M5CyMSUS6