Skip to content

Phase 5: extended multivariate test battery - #6

Open
jameshoweee wants to merge 1 commit into
jh/phase4-sequencefrom
jh/phase5-multivariate
Open

Phase 5: extended multivariate test battery#6
jameshoweee wants to merge 1 commit into
jh/phase4-sequencefrom
jh/phase5-multivariate

Conversation

@jameshoweee

Copy link
Copy Markdown
Owner

New file multivariate_tests.py with 7 tests for the multivariate sampler output:

  • squared norm test: ||x||^2 / sigma^2 ~ chi2(p) via KS — catches radial flaws invisible to marginals
  • Fisher + Benjamini-Hochberg: proper per-coordinate p-value combination replacing informal counting
  • max off-diagonal correlation: catches a single pair of coords sharing randomness (AVX2 lane reuse)
  • FFT-domain battery: per-frequency variance + Re/Im independence + higher criticism in the DFT basis. ffSampling flaws localize here
  • cross-key homogeneity: energy distance between samples from different keys — tests GPV key-independence
  • two-sample test: KS/CvM/energy for cross-implementation comparison
  • Henze-Zirkler: affine-invariant multivariate normality, MC-calibrated (analytic log-normal null is miscalibrated at p>=128)

New multivariate test vectors: norm_inflated, cross_key, fft_weak.

New tests (code/multivariate_tests.py):
- Squared-norm test (5.1): ||x||^2/sigma^2 ~ chi2(dim) via KS.
  Catches radial flaws from coordinate correlation.
- Fisher+BH meta-layer (5.2): Fisher combination of per-coordinate
  p-values for global verdict + BH for localization. Fixes the
  informal "X out of dim pass" count.
- Max off-diagonal correlation (5.3): max|rho_ij| with Jiang's
  Gumbel limit. Catches single-pair correlation that diagcov's
  diagonal sums dilute.
- FFT-domain battery (5.4): per-frequency variance, Re/Im
  independence, higher criticism across frequencies. ffSampling
  flaws are localized in the FFT basis.
- Cross-key homogeneity (5.5): two-sample energy distance with
  permutation test. Tests the GPV key-independence property.
- Two-sample tests (5.6): per-coordinate KS + CvM with BH
  correction for cross-implementation comparison.
- Henze-Zirkler (5.7): MC-calibrated (not analytic log-normal,
  which is uncalibrated for p >= 128). Shares pairwise distance
  computation with energy test.

Integration:
- MultivariateSamples.run_multivariate_battery() runs all new tests
- to_dict() includes extended results

New test vectors:
- mv_bad_norm_inflated: all coords share common factor (norm test)
- mv_bad_cross_key: mixed sigmas simulating key-dependent output
- mv_med_fft_weak: frequency at 70% variance (subtle FFT flaw)

Test suite: 125 passed, 0 skipped, 0 failed
@jameshoweee

Copy link
Copy Markdown
Owner Author

consolidating into a single PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant