Skip to content

v0.2.1: exact PSD check for block_equicorr, kwargs no longer mutated

Latest

Choose a tag to compare

@microprediction microprediction released this 23 Sep 19:31
· 7 commits to main since this release

Fixes from the ensemble-by-ensemble audit that change no output on any documented call path. Matrices for a given seed are identical to 0.2.0.

  • block_equicorr checks positive semidefiniteness exactly. The old guard, rho_within >= rho_between, is necessary but not sufficient: with rho_between < 0 it returned matrices with eigenvalues below -3 at the defaults, silently. The check now uses the exact spectrum of a block-equicorrelation matrix (the (1 - rho_within[b]) eigenvalues plus the B x B reduced matrix), costs O(B^3), and raises ValueError when the matrix would not be PSD. Verified against dense eigendecomposition on 200 random parameter sets straddling the boundary. Default draws are bit-identical to 0.2.0.
  • random_correlation_matrix no longer writes into the caller's corr_kwargs (and random_covariance_matrix, which delegates to it, inherits the fix). It called setdefault("rng", rng) on the dict passed in, so a dict shared across calls kept the first call's seed and later calls with a different rng= returned the same matrix.
  • Docstrings corrected: kernel_corr no longer claims full rank (it is numerically singular from n of about 100 without a nugget) and says that nu="rbf" is the default; wishart_corr returns an ndarray with degrees of freedom fixed at 2n; factor_corr documents that the default geometric strength makes k beyond about 4 undetectable.
  • Two legacy lkj tests that had been inverted to pass the pre-0.2.0 generator now test what their docstrings say.

Known and deferred until the paper's scale grid finishes, because each changes output for a given seed: animals uses the legacy global np.random.seed and gives different matrices for rng=7 and rng=np.random.default_rng(7); archakov_hansen's fixed point silently stops short of convergence for n above about 200; kernel_corr has no nugget.