Repository navigation
Tests: a README, and statistical consistency checks against a known posterior - #191
Merged
patnr merged 1 commit intoOct 29, 2026
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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 README to
tests/, and a new test module,test_statistical_consistency.py.The README describes the cases the methods are run on end to end (Van der Pol, the linear 1D field, MiniRes, Rosenbrock and the quadratic), and which scheme and analysis is checked on which case, and how: pinned numbers, property tests, the benchmark, or the new checks. The unit and regression tests are left to their docstrings.
The new checks are a linear sanity check. With a linear model and a Gaussian prior and noise, the posterior is known exactly, so every registered scheme and analysis is compared with the correct answer, on its mean and its spread, rather than with previously pinned numbers. The cases are multivariate but not spatial: 1, 2 and 10 unknowns, with a random prior correlation, a dense random
G, and noise variances spanning three orders of magnitude. The reference is the exact update of the prior ensemble's own mean and covariance, so prior sampling error does not count against a method; the rest is averaged over 5 seeds of 100 members.Combinations left out are listed in
EXCLUDED, each with its reason, and expected deviations inDEVIATIONS, as strict xfails, so that a fix shows up as a failure until its entry is removed. The tolerances were set from repeated runs with independent seeds.The module runs in about 20 s.
Checked locally: the new module, and ruff.
🤖 Generated with Claude Code