3.2.2. The main sampler classes
The sampler classes are built with the same skeleton. They consist in a three steps procedure: init,
generateSample and terminate. There are five different types of Stochastic sampler that can be
used:
TSampling: general sampler where the sampling is done with the Iman and Conover methods ([IC82]) that uses a double Cholesky decomposition in order to respect the requested correlation matrix. This methods has the drawback of asking a number of samples at least twice as large as the number of attribute.TBasicSampling: very simple implementation of the random sampling that can, as well, produce stratified sampling. As it is fairly simple, there is no lower limit in the number of random samples that can be generated and generation is much faster when dealing with a large number of attributes than with theTSampling. On the other hand, even though a correlation can be imposed between the variables, it will be done in a simple way that cannot by construction respect the stratified aspect (if requested, see [Bla17] explanations).TMaxiMinLHS: class recently introduced to produced maximin LHS, whose purpose is to get the best coverage of the input space (for a deeper discussion on the motivation, see [Bla17]). It can be used with a provided LHS drawing or it can start from scratch (using theTSamplingclass to get the starting point). The result of this procedure can be seen in Figure 13.14 which was procuded with the macro introduced in Macro “samplingMaxiMinLHSFromLHSGrid.C”;Tip
The optimisation to get a maximin LHS is done on the mindist criterion: let \(D=[\mathbf{x}_1, \cdots,\mathbf{x}_N] \subset [0,1]^{d}\) be a design-of-experiments with \(N\) points. The mindist criterion is written as: \( \min_{i,j}{||\mathbf{x}_i-\mathbf{x}_j||_{2}}\) where \(||.||_2\) is the euclidian norm.
This information can be computed on any grid, by calling the static function
double mindist = TMaxiMinLHS::getMinDist(TMatrixD LHSgrid);
TConstrLHS: class recently introduced to produced constrained LHS, whose purpose is to get nicely covered marginal laws while respecting one or more constraints imposed by the user. It can be used with a provided LHS drawing or it can start from scratch (using theTSamplingclass to get the starting point) and it is discussed a bit further in TConstrLHS example. The result of this procedure can be seen in Figure 13.15 which was procuded with the macro introduced in Macro “samplingConstrLHSLinear.C”;TGaussianSampling: very basic sampler specially done for cases composed with only normal distributions. It relies on the drawing of a sample \(A \left(n_{S},\, n_{X}\right)\) \(n_{S}\) being the number of sample and \(n_{X}\) the number of inputs. The sample is transformed to account for correlation (see [Bla17]) and shifted by the requested mean (for every variables).TImportanceSampling: use the same method asTSamplingbut should be used when oneTAttributehas a son. In this case the range for the considered attribute is the sub-range used to define the son and there is specific reweighting procedure to take into account the fact that the authorised range is reduced. LHS is therefore used by default.