Repository navigation
Optional smooth climate curve term for the spread formula (spreadClimateCurve) - #118
Merged
Merged
Conversation
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Lx3DXhXsFis2pbqBTh2PPh
…s sd (replaces the hard hinge) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Lx3DXhXsFis2pbqBTh2PPh
…l, climateTermBase); test that addAnnualYoungAge returns its input Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Lx3DXhXsFis2pbqBTh2PPh
…265) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Lx3DXhXsFis2pbqBTh2PPh
eliotmcintire
added a commit
that referenced
this pull request
Nov 26, 2026
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 an optional smooth extra climate term to the spread model's formula, so the model can respond more steeply to climate in dry years. It is off by default.
Affects: Nothing changes unless
spreadClimateCurve = TRUE; the default formula string, covariate tables and ledger rows are the same as before.Depends-on: PredictiveEcology/fireSenseUtils#265
Depends-on: PredictiveEcology/fireSense_spreadFit#146
Depends-on: PredictiveEcology/fireSense_spreadPredict#53
Technical details
New parameter
spreadClimateCurve(defaultFALSE), next tospreadClimateSplit. WithTRUEeach spread climate variableCgets a covariateC_curve = softplus(C - k, s)(fireSenseUtils::softplus()) with its own coefficient, after the variable's other climate terms in the formula (spreadRHS(climateCurve =); it does not interact).kis the ELF's median andsits sd ofCover the burnable pixels of all the fit years.annualSpreadCovariates()(fireSense_dataPrepFit.R) makes the term from the pixel's own value beforesplitSpreadClimate()removes it, reusing the burnable-pixel climate the split already reads, and returnskandsas an attribute thatprepare_SpreadFit()puts insim$climateCurvePars(new output).fireSense_spreadFitstores it in the ledger row andfireSense_spreadPredictrebuilds the term from it. The coefficient's sign is free; a negative value would flatten the dry side. A reused ledger fit keeps its own curve terms andk,s(mod$spreadClimateCurve, as for the split). The new fireSenseUtils functions (addClimateCurve(),climateCurvePars(),softplus(),climateTermCols()) are in theprepSpreadFitDatacache key.Reuses:
fireSenseUtils::climateCurvePars(),addClimateCurve(),climateCurveSuffix,softplus(),ledgerClimateCurvePars()(fireSenseUtils#265); the module'sclimateAt(burnableIndex),useClimateSplit()pattern (useClimateCurve()),spreadRHS(),fireSenseUtils::climateTermCols()/isClimateTermCol(); new:useClimateCurve()(the same three-line rule asuseClimateSplit()for the curve flag). The fixtureswholeFixture()andownAndNeighbourLedger()moved from two test files intohelper-spreadFixtures.Rso a third test file can use them.Tests: new
test-spreadClimateCurve.R(values with the storedk,s; reusedk,s; with the split; unchanged without; formula order; parameter default; reuse rules from the ledger) and a test thataddAnnualYoungAge()returns the list it is given with its tables changed in place. Module suite (convertToPackage()+test_local(), scratch library, fireSenseUtils from the branch): base 157 blocks, 614 passed, 0 failed; the new test file on the base code: 13 fail; branch 167 blocks, 656 passed, 0 failed, 1 skipped (needs a fixture variable, as on the base). CItestthat-module / Test modulepasses.🤖 Generated with Claude Code
https://claude.ai/code/session_01Lx3DXhXsFis2pbqBTh2PPh