Skip to content

Add LatinHypercube sampler as well as tests and a demonstrating notebook - #324

Open
Samuel-Vangu wants to merge 1 commit into
theochem:masterfrom
Samuel-Vangu:feature/add-latin_hypercube-sampler
Open

Add LatinHypercube sampler as well as tests and a demonstrating notebook#324
Samuel-Vangu wants to merge 1 commit into
theochem:masterfrom
Samuel-Vangu:feature/add-latin_hypercube-sampler

Conversation

@Samuel-Vangu

Copy link
Copy Markdown

Adds a LatinHypercube sampling 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 marginal
    exactly (McKay, Beckman & Conover, 1979); randomize=False centers points
    in 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)
image
  • an example notebooks in examples/, per your earlier note about wanting a
    concrete use case: both compare LatinHypercube against baselines already
    in grid (plain Monte Carlo, Tensor1DGrids/Trapezoidal) on two
    chemistry-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.

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