Repository navigation
Add the "powerLaw" spread link - #167
Merged
Merged
Conversation
powerLawLink() is called by logisticAll(link = "powerLaw"), so spreadProbFromCovs(), the objective, the gates, the validation and runDEoptim() all take link = "powerLaw" and powerLawGamma. The year effect is added to x. The default link and its cache keys are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014G18Mik3fH4z5M5CyMSUS6
This was referenced Oct 19, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## development #167 +/- ##
===============================================
+ Coverage 89.44% 89.47% +0.03%
===============================================
Files 51 51
Lines 4451 4466 +15
===============================================
+ Hits 3981 3996 +15
Misses 470 470 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…288, above spreadProbCeiling 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
Oct 19, 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.
Adds a third way to turn the fitted covariates into a spread probability, built from a percolation calibration. Under it a wet or dry year can no longer push every fire past the percolation threshold. It is off by default.
Affects: Nothing changes unless
link = "powerLaw"is asked for; the default link gives the same numbers and the same cache keys as before.Technical details
Before this, the year random effect was added on the logit of the final
p(objFunSpread.R,objFunInner()), which lets a year takeppast the percolation threshold. New exportedpowerLawLink()(helpers.R) isp = pc - (pc - floor) * exp(-x / gamma)withxthe linear predictor,pcin themaxAsymptoteslot (fitted),floor = lowerSpreadProb,gammafixed (spreadPowerLawGamma= 1.9, not fitted because it is confounded with the coefficient scale), andp < 0set to 0.logisticAll(link = "powerLaw", gamma)calls it, sospreadProbFromCovs(),.objfunSpreadFit(),spreadProbGates(),spreadFitValidationData()andrunDEoptim()takelink = "powerLaw"andpowerLawGamma; with it the year effect is added tox.powerLawOmitArgs()leavespowerLawGammaout ofrunDEoptim()'s cache key and re-score arguments unless the link is"powerLaw". New constants:spreadFitPowerLawGammaTxt(ledger column),"powerLaw"inspreadLinkOptions,spreadPowerLawPcBounds(0.14 to 0.35, the bounds ofpc; runaway simulations on five real ELF landscapes put the threshold at 0.258-0.288, sospreadProbCeiling0.276 would bind). Combining it withclimateRefstops.Tests: new
test-powerLaw.R(link values,"ceiling"unchanged and bit-identical, year effect constant onxand not on the logit, gates, validation,runDEoptim()arguments and keys); the toy fixture oftest-climateOutside.Rmoved tohelper-spreadLinkFixture.Rto share it.test-powerLaw.Rfails on development (nopowerLawLink, unused argumentpowerLawGamma). Full suite: 2136 pass, 0 fail on this branch; 2094 pass, 0 fail on development.R CMD check --no-manual: 0 errors, 0 warnings, 0 notes. Scratch library only.🤖 Generated with Claude Code
https://claude.ai/code/session_014G18Mik3fH4z5M5CyMSUS6