Draw an independent proposal per walker for full-covariance GaussianMove - #571
Merged
Merged
Conversation
…sianMove rng.multivariate_normal was called without a size argument when a full covariance matrix was supplied, so a single random vector was generated and broadcast to every walker's position. This made all proposed steps identical within an iteration, breaking the ensemble walkers' independence for GaussianMove(cov) with a 2D cov matrix. Signed-off-by: Mike German <mike@stepsventures.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.
When
GaussianMoveis built with a full (2D) covariance matrix,rng.multivariate_normal(...)was called withoutsize=, so it drew a single random vector that got broadcast identically onto every walker's coordinates. That destroys inter-walker independence, which ensemble MCMC relies on. The fix addssize=x0.shape[0]so each walker gets its own draw.Reproduced on current main: all 8 walkers received bit-identical proposal deltas. Existing integration tests missed it because they only check aggregate marginal statistics, not per-walker independence. Added
test_full_covariance_proposal_is_independent_per_walker, which fails before the fix and passes after. Full suite 129/129.