Repository navigation
Predict from spread-link rows "powerLawSmooth" and "richards" - #39
Merged
Merged
Conversation
The row's link, lowerAsymptote_spread and richardsNu_spread are read and applied with fireSenseUtils::spreadProbFromCovs(). New output fireSense_SpreadLink names the link; fireSense_SpreadPowerLaw and fireSense_SpreadLinear are given for all three linear-predictor links, with the link's own parameter names. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014G18Mik3fH4z5M5CyMSUS6
…ils::checkLinkParams() Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014G18Mik3fH4z5M5CyMSUS6
eliotmcintire
added a commit
that referenced
this pull request
Nov 13, 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.
Spread probability had no minimum after the switch to the power-law link, so escaped fires stopped early in low-spread years. Two new smooth links with a set minimum fix that; this lets the spread prediction read a fit made with either of them. Fits made with the existing link predict exactly as before.
Affects: predictions from ledger rows of the two new links; every other row predicts as it did.
Depends-on: PredictiveEcology/fireSenseUtils#229
Depends-on: PredictiveEcology/SpaDES.tools#157
Technical details
Defect: prediction knew one linear-predictor link.
spreadProbOneELF()calledspreadProbFromCovs(link = if (!is.null(powerLawGamma)) "powerLaw")(fireSense_spreadPredict.R:429ondevelopment) andledgerPowerLawGamma()(:521) accepted only"powerLaw";powerLawParsOf()(:469) returnedpc, gamma, floor, shapeonly.Fix:
ledgerLinkArgs()reads the row's link and, for the links that have them,powerLawGamma_spread,powerLawShape_spread,lowerAsymptote_spread,richardsNu_spread(a missing or invalid value stops)."richards"has no gamma. Both the one-ELF and the several-ELF paths use it, andspreadProbOneELF()passes the link on tofireSenseUtils::spreadProbFromCovs().fireSense_SpreadLink.fireSense_SpreadPowerLawandfireSense_SpreadLinearare given for all three links; the parameter names arefireSenseUtils::spreadLinkParNamesof the link (powerLaw: pc, gamma, floor, shape;powerLawSmoothaddslower;richards: pc, lower, nu, B). Several fitted ELFs with different linear-predictor links cannot be blended, an error.reqdPkgsfloors.Tests (
tests/testthat/test-smoothLinks.R, new): a row of each link predicts the hand-computed link values for L = 0, 0.05, 0.13 and nu = 0, 0.5, 2;"richards"row without a gamma column works (no calibration anywhere in this module); L = 0.13 keeps a very low-x pixel at 0.13; invalid or missing columns stop; the multi-ELF blend and the different-link error;test-metadata.Rlists the new output.Full suite (module converted with
convertToPackage(buildDocuments = TRUE),test_local()): branch 302 pass, 0 fail, 0 skipped;development251 pass, 0 fail, 0 skipped. Needs the two package PRs installed (scratch library). Not run on the fireSenseUtils/SpaDES.toolsdevelopmentalone, where the new links do not exist.Reuses:
fireSenseUtils::spreadProbFromCovs(),linearLinkPars(),spreadLinkParNames,spreadAsymptoteLinks, the existingledgerPowerLawGamma()/ledgerPowerLawShape()pattern, andpowerLawParsOf()(generalized in place); new:ledgerSpreadLink(),ledgerLinkNumber(),ledgerLowerAsymptote(),ledgerRichardsNu(),ledgerLinkArgs()(no reader of these ledger columns exists;ledgerLinkNumber()is the one validator for the two numbers).🤖 Generated with Claude Code
https://claude.ai/code/session_014G18Mik3fH4z5M5CyMSUS6