Add LatinHypercube sampler as well as tests and a demonstrating notebook - #324
Open
Samuel-Vangu wants to merge 1 commit into
Open
Add LatinHypercube sampler as well as tests and a demonstrating notebook#324Samuel-Vangu wants to merge 1 commit into
Samuel-Vangu wants to merge 1 commit into
Conversation
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 a
LatinHypercubesampling class for integration on (hyper)cubic grids,following up on the discussion in #322 .
What's included
src/grid/latin_hypercube.py:LatinHypercube(n_points, dimension, seed=None, randomize=True, origin=None, axes=None). Stratifies every 1D marginalexactly (McKay, Beckman & Conover, 1979);
randomize=Falsecenters pointsin their stratum instead of jittering them. Supports mapping onto an
arbitrary parallelepiped via
origin/axes.src/grid/tests/test_latin_hypercube.py: 23 tests (stratification property,weights, domain mapping, integration accuracy, reproducibility)
examples/, per your earlier note about wanting aconcrete use case: both compare
LatinHypercubeagainst baselines alreadyin
grid(plain Monte Carlo,Tensor1DGrids/Trapezoidal) on twochemistry-motivated integrands -- a sum of independent harmonic oscillators
(additive) and a product of Gaussian-type functions (non-additive) -- to
show honestly where LHS helps and where it doesn't.