Skip to content

Predict with the smooth climate curve term from the ledger row's k and s - #53

Merged
eliotmcintire merged 4 commits into
developmentfrom
climateHinge
Nov 26, 2026
Merged

eliotmcintire merged 4 commits into
developmentfrom
climateHinge

Conversation

@eliotmcintire

@eliotmcintire eliotmcintire commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

When the spread model has the new optional dry-year climate term, a forecast now builds that term the same way the fit did. Without this, a fit made with the term could not be used for prediction.

Affects: Fits made with the new smooth climate curve term predict from it; every other ledger row predicts exactly as before. No new parameter.

Depends-on: PredictiveEcology/fireSenseUtils#265

Technical details

spreadProbOneELF() (fireSense_spreadPredict.R) has a new argument climateCurvePars, read from the ledger row at both call sites (one ELF and blended ELFs) with fireSenseUtils::ledgerClimateCurvePars(). For each fitted coefficient <var>_curve it calls fireSenseUtils::addClimateCurve() (softplus(<var> - k, s)) on the pixel's own raw <var>, before splitSpreadClimate() removes that variable, so it works with spreadClimateSplit too. A curve coefficient with no k and s in the row, or no climate covariate, stops with a message naming it. The coefficient's sign is free; a negative value flattens the dry side. reqdPkgs floor fireSenseUtils (>= 0.2.3.9193) is a placeholder until the fireSenseUtils PR merges and is bumped.

Reuses: fireSenseUtils::ledgerClimateCurvePars(), addClimateCurve(), climateTermBase(), isClimateTermCol(), climateCurveSuffix (fireSenseUtils#265) and the existing needed / splitSpreadClimate() flow; new: none in this module.

Tests: new tests/testthat/test-climateCurve.R (prediction equals the hand value built with the fit's addClimateCurve() from the stored k and s; positive coefficient raises and negative lowers the prediction; missing k/s stops; a row without curve terms, even with k/s stored, predicts as before; with a split fit). Module suite (convertToPackage() + test_local(), scratch library, fireSenseUtils from the branch): base 120 test blocks, 426 passed, 0 failed; the new test file on the base code: 5 fail; branch 125 blocks, 435 passed, 0 failed. CI testthat-module / Test module passes.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Lx3DXhXsFis2pbqBTh2PPh

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Lx3DXhXsFis2pbqBTh2PPh
@eliotmcintire eliotmcintire added enhancement New feature or request backwards compatible Existing code and results keep working unchanged labels Nov 25, 2026
…s sd (replaces the hard hinge)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Lx3DXhXsFis2pbqBTh2PPh
@eliotmcintire eliotmcintire changed the title Predict with the climate hinge term from the ledger row's knots Predict with the smooth climate curve term from the ledger row's k and s Nov 25, 2026
eliotmcintire and others added 2 commits November 25, 2026 17:09
…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
@eliotmcintire
eliotmcintire merged commit 69189ca into development Nov 26, 2026
9 checks passed
@eliotmcintire
eliotmcintire deleted the climateHinge branch November 26, 2026 04:18
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backwards compatible Existing code and results keep working unchanged enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant