Repository navigation
fix(observations): marginalise a gap on the bare path, and draw a blank series everywhere - #392
seabbs-bot wants to merge 3 commits into
Conversation
…nk series everywhere A gap in a plain vector handed to a bare error model was sampled as a latent, where the same series through a NamedTuple field or an IDModel was marginalised. The bare path now narrows its series the same way, so a blank leaves the likelihood on every route and the caller's array is never written into. A series with nothing observed in it was a carrier that marginalised the whole series on the narrowing routes and a predictive draw on the bare one. It is the same request as missing, so it now takes the predictive form at its own length on every route. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Lw3PbYZfA1dZhfaaE9tbdp
Try this Pull Request!Option 1: Julia Package ManagerOpen Julia and type: import Pkg
Pkg.activate(temp=true)
Pkg.add(url="https://github.com/EpiAware/ComposableTuringIDModels.jl", rev="claude/prs-issues-triage-p548ev-blank-series")
using ComposableTuringIDModelsOption 2: Local CheckoutIf you have the repo locally: git checkout claude/prs-issues-triage-p548ev-blank-series
julia --project=. -e "using Pkg; Pkg.instantiate()" |
Benchmark comparison vs baseMinimum time per call. Buckets are PR time as a % of base, so lower is faster (🟢 faster, ⚪ within 5%, 🔴 slower). Counts of benchmarks per bucket:
Evaluation — 9 benchmarks (by time change)
AD gradients — 7 benchmarks (by time change)
|
The rebuild-coverage test item added in #372 does `using InteractiveUtils: subtypes`, but the stdlib was never added to `test/Project.toml`. Julia 1.12 refuses to load a stdlib that is not in the active environment, so every test matrix job on a branch carrying that item errors in `reconstruction.jl`. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Lw3PbYZfA1dZhfaaE9tbdp (cherry picked from commit 4d7322a)
Codecov Report✅ All modified and coverable lines are covered by tests.
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 6 files with indirect coverage changes 🚀 New features to boost your workflow:
|
|
CI status on e51bd34. Every test matrix job,
Generated by Claude Code |
main dropped a cross-reference from the _scored_series comment that this branch had already rewritten, so the branch's comment and method stand. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Lw3PbYZfA1dZhfaaE9tbdp
|
📖 Documentation preview is ready! View the docs for this PR at: https://EpiAware.github.io/ComposableTuringIDModels.jl/previews/PR392/ This preview will be updated automatically when you push new commits. |
Closes #343
Option 1 from the issue, as agreed there.
The two routes disagreed
A gap in a plain vector handed to a bare error model reached DynamicPPL's
y_t[i] ~ distsugar and was sampled as a latent.The same series through a
NamedTuplefield or anIDModelwas narrowed withconcrete_observationsand the gap marginalised.Two routes into one error model gave different posteriors for the same data.
What changes
_scored_seriesnarrows the bare path too, so a gap is aMissingObservationscarrier on every route, scored by reading only, and the caller's array is never written into.A series with nothing observed in it is the same request as
missing, a predictive draw at that length.concrete_observationsnow returns aVector{Missing}of that length for one, whatever its element type, where it used to build an all-false carrier that marginalised the whole series on the narrowing routes and drew on the bare one.That is the one behaviour change a caller can see: an
IDModelor aNamedTuplefield givenVector{Union{Missing, Int}}(missing, n)now simulates the series rather than returningnmissings.A
Spliton a blank data matrix already drew, so it is unchanged, which is what ruled out the narrower fix recorded on the issue.Tests
The all-blank case in the
concrete_observationsitem and the blankNamedTuplefield case in the observations item now pin the predictive form.A new item checks the bare vector and the
NamedTuplefield give the same empty parameter set and the same log-joint for[5, missing, 7], leave the caller's array alone, and draw a blank series at its own length.The compose, observations, split, inference and requirements items pass locally, 480 of 480.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Lw3PbYZfA1dZhfaaE9tbdp
Generated by Claude Code