Add mixed distribution support to TrueMeasure - #615
Open
Laasya-73 wants to merge 1 commit into
Open
Conversation
fjhickernell
requested changes
Sep 2, 2026
fjhickernell
left a comment
Member
There was a problem hiding this comment.
Thanks for doing this Laasya.
We talked and I requested an example showing the advantage of mixture sampling over non-mixture sampling. Let me know when you have added that.
Collaborator
Author
Sure!! |
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.
Summary
This PR adds support for finite mixed distributions through a new
MixtureTrueMeasure.Given component distributions with densities
and probabilities
the resulting mixed distribution has density
To sample from the mixture,
Mixtureuses one additional uniform coordinate. For a component dimensiond, the outer sampler therefore has dimensiond + 1.For
the first coordinate$u_0$ selects a component according to the cumulative probabilities, and the remaining coordinates $(u_1, \ldots, u_d)$ are passed through the selected component's existing
TrueMeasuretransform. The resulting sample is in dimensiond.Implementation
MixtureTrueMeasurethat can combine different compatibleTrueMeasurecomponents.d + 1sampler dimension.TrueMeasures are preserved.Mixturethrough the publicqmcpyAPI.A new demo notebook shows the selection mechanism as well as mixtures involving different component types, including Gaussian, zero-inflated, bounded, heavy-tailed, composed, and multidimensional examples.
Tests
Added focused tests for component selection, cumulative-probability boundaries, validation, mixture weights, composed transforms, spawning, and replicated samples.