|
CMP++: Uncertainty Quantification & Bayesian Calibration
|
Latin Hypercube Sampling (LHS) grid generator. More...
#include <grid.h>


Public Member Functions | |
| LatinHypercubeGrid (const Eigen::Ref< const Eigen::VectorXd > &lowerBound, const Eigen::Ref< const Eigen::VectorXd > &upperBound, unsigned int seed=42) | |
| Constructs a LatinHypercubeGrid generator. | |
| Eigen::MatrixXd | construct (const size_t &nPoints) override |
| Constructs a Latin Hypercube matrix of samples. | |
| size_t | dim () const override |
| Returns the dimension of the domain. | |
Public Member Functions inherited from cmp::grid::Grid | |
| virtual | ~Grid ()=default |
Private Attributes | |
| size_t | dimension_ |
| Number of dimensions. | |
| std::default_random_engine | rng_ |
| Pseudo-random number generator. | |
| Eigen::VectorXd | lowerBound_ |
| Lower bounds vector. | |
| Eigen::VectorXd | upperBound_ |
| Upper bounds vector. | |
Latin Hypercube Sampling (LHS) grid generator.
Mathematical Formulation For each dimension \(d \in \{1,\dots,D\}\), LHS divides the domain range \([a_d, b_d]\) into \(N\) equal-probability bins. The coordinate values for the \(i\)-th sample is placed inside the \(\pi_d(i)\)-th bin:
\[ x_{i, d} = a_d + \frac{b_d - a_d}{N} \left( \pi_d(i) - 1 + u_{i,d} \right) \]
where \(\pi_d\) is a random permutation of the set \(\{1,\dots,N\}\) chosen independently for each dimension, and \(u_{i,d} \sim \mathcal{U}(0, 1)\) is a random jitter.
Implementation Algorithm
|
inline |
Constructs a LatinHypercubeGrid generator.
| lowerBound | The lower bounds of the hyperrectangle. |
| upperBound | The upper bounds of the hyperrectangle. |
| seed | Seed for the random number generator. |
|
inlineoverridevirtual |
Constructs a Latin Hypercube matrix of samples.
| nPoints | Number of points to generate. |
Implements cmp::grid::Grid.
|
inlineoverridevirtual |
Returns the dimension of the domain.
Implements cmp::grid::Grid.
|
private |
Number of dimensions.
|
private |
Lower bounds vector.
|
private |
Pseudo-random number generator.
|
private |
Upper bounds vector.