Skip to content

paramSets, repsPerSet: predict with parameter sets from a file - #41

Merged
eliotmcintire merged 2 commits into
developmentfrom
paramsets
Nov 15, 2026
Merged

eliotmcintire merged 2 commits into
developmentfrom
paramsets

Conversation

@eliotmcintire

Copy link
Copy Markdown
Collaborator

This lets a spread prediction use many parameter sets from a file, for example a whole fitting population, instead of only the fitted ones. Each set is used for a chosen number of replicates, so many sets can be scored cheaply.

Affects: nothing by default; with the new paramSets setting the simulated ELF predicts with the sets in the file.

Reuses: spreadPredictRun(), spreadProbOneELF(), paramSetIndex(), ledgerLinkArgs(), ledgerCovMinMax()/ledgerCovCentre() (link, lower asymptote, gamma and centres stay from the ledger row), randomEffectSDOf(), fireSenseUtils::spreadRandomEffectTxt; new: paramSetsForRep() (reads the file and picks the set; nothing existing reads parameter sets from a file), surfaceOutputs and mod$surface (cache of one set's outputs; no existing cache of them). fireSenseUtils::readSpreadFitLedger() is not used: it reads the Drive ledger by domain, not an arbitrary file; a file of ledger rows (a params list column) is read directly.

Technical details
  • fireSense_spreadPredict.R: new params paramSets (path to .rds/.csv, default NA) and repsPerSet (default 1L), new input .ELFind (finds the own ELF's row when there are several). In spreadPredictRun(), when paramSets is set, the own ELF's params are replaced by one set (paramSetsForRep()); neighbours keep their rows, so blending is unchanged.
  • Rep r uses set paramSetIndex(nSets, ceiling(r / repsPerSet)) and calls set.seed(k), k = ((r - 1) %% repsPerSet) + 1, so fireSense_burn's later draws are the same for every set (common random numbers). The set index goes into fireSense_SpreadParamSet.
  • The outputs are cached in mod$surface, keyed on set index and the covariate table; same-set reps copy them, a new set recomputes. Time is not in the key (one covariate table, so it does not change the result).
  • A set must contain every column of the ledger row's params (random-effect sds excepted), else it stops naming the missing ones. Extra columns (e.g. an objective value) are dropped.
  • Tests (tests/testthat/test-paramSets.R, plus test-metadata.R updated for the new names): default unchanged; 2 sets x 2 reps use sets 1,1,2,2 with their own surfaces and sds (rds and csv); same-set reps reuse the surface (marker planted in the cache); same seed for the k-th rep of each set; a set equal to the ledger row gives an identical surface; missing coefficient stops; with two ELFs only the own ELF changes.
  • Suite (convertToPackage() + test_local(), fireSenseUtils 0.2.3.9165 from the read-only dev library): branch 330 pass, 0 fail, 0 skip; base 303 pass, 0 fail, 0 skip. The new test file on base: 21 failures, 309 pass.
  • Version not bumped; NEWS entry added.

🤖 Generated with Claude Code

https://claude.ai/code/session_014G18Mik3fH4z5M5CyMSUS6

…n random numbers per replicate within a set

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014G18Mik3fH4z5M5CyMSUS6
@eliotmcintire eliotmcintire added enhancement New feature or request backwards compatible Existing code and results keep working unchanged labels Nov 15, 2026
…Find and random-effect column errors

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014G18Mik3fH4z5M5CyMSUS6
@eliotmcintire
eliotmcintire merged commit 2a17a30 into development Nov 15, 2026
9 checks passed
eliotmcintire added a commit that referenced this pull request Nov 15, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014G18Mik3fH4z5M5CyMSUS6
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