Phase 4: sequence tests — Ljung-Box, runs, block homogeneity - #5
Open
jameshoweee wants to merge 1 commit into
Open
Phase 4: sequence tests — Ljung-Box, runs, block homogeneity#5jameshoweee wants to merge 1 commit into
jameshoweee wants to merge 1 commit into
Conversation
New tests added to univariate_tests.py: - Ljung-Box (4.1): Q(h) = n(n+2) * sum r_k^2/(n-k) ~ chi2(h), tests serial autocorrelation up to lag 20. Catches Markov- coupled samplers with perfect marginals. - Wald-Wolfowitz runs test (4.2): tests randomness of above/below- median sequence. ~20 lines, marginal power beyond Ljung-Box but catches non-linear dependence. - Block homogeneity (4.3): chi-square homogeneity across 10 stream blocks. Catches mid-run drift or state corruption invisible to pooled distributional tests. All three integrated into run_extended_battery(). Baseline results: - Bad detection: 85.7% -> 100.0% (Markov 0/6 -> 6/6) - Good false alarms: 0/6 (0%) — unchanged - ZERO remaining blind spots across all 7 flaw types Test suite: 122 passed, 0 skipped, 0 failed
Owner
Author
|
consolidating into a single PR |
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 3 sequence-dependence tests to univariate_tests.py — these close the last blind spot where a sampler has perfect marginals but serial correlation (e.g. Markov-coupled output):
After this, all generated bad vectors (including markov-coupled ones) are detected. 0% false alarms on good vectors.