Repository navigation
Multiply the expected ignitions by the fit's spatial field - #51
Merged
Merged
Conversation
A fit with modelList$spatialField (fireSense_ignitionFit spatialField = "twoStage") has each pixel's expected ignitions multiplied by exp(f). The factor is made once per fit and kept in mod. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Lx3DXhXsFis2pbqBTh2PPh
eliotmcintire
added a commit
that referenced
this pull request
Nov 30, 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.
Fire ignition predictions can now include a smooth map of where ignitions are more or less likely than the fitted model alone expects. A fit that carries such a map has its expected ignitions scaled up or down place by place.
Affects: nothing for existing fits. A fit made with the new spatial field option (in the ignition fit module) has its expected ignitions per pixel multiplied by the field's factor; escapes are unchanged.
Depends-on: PredictiveEcology/fireSenseUtils#269
Technical details
The fit stores the field as plain numbers,
modelList$spatialField(fireSenseUtilsfitSpatialField()).IgnitionPredictRun()multiplies each pixel's ignition mean byexp(f)(fireSense_ignitionPredict.R, thepredsIgns[f$rows]line).spatialFieldFactorOf()makes the factor for every cell ofignitionFitRTMonce per fit, throughfireSenseUtils::spatialFieldFactor()(rasterise the field on its fit grid, project toignitionFitRTMonly if the geometry differs), and keeps it inmod$spatialFactorfor the following years; it is made again only if the fit's field changes. Pixels outside the fitted area, or NA in the field, get a factor of 1, as does a fit without a field. With several ELFs each fit applies its own field to its own pixels.reqdPkgs: fireSenseUtils floor 0.2.3.9199, the version the fireSenseUtils PR is expected to be bumped to (TODO in the comment: confirm after it merges). The module calls nomgcvfunction, somgcvis in fireSenseUtils' imports, not here.Reuses:
fireSenseUtils::spatialFieldFactor(),foldMeanPrediction(),ignitionFitsByELF(), the toy fit helpers ofsetup-toyIgnition.R; new:spatialFieldFactorOf()(keeps the factor between years; nothing existing caches per-fit results acrossrunevents).Tests (written first;
test-spatialField.R, plus one intest-multiELF.R): a field of known factors multiplies the means, escapes untouched; no field is identical to before; NA and unreached pixels are 1; the field of a larger grid is projected; the factor is made once over three years; a field saved withsaveRDS()and reloaded predicts identically; each ELF's field applies to its own pixels. On the base the new tests fail (7 failures). Full suite (convertToPackage + test_local, scratch library with fireSenseUtils from the PR branch): branch 159 passed, 0 failed; base 148 passed, 0 failed.NEWS bullet added; no version bump.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Lx3DXhXsFis2pbqBTh2PPh