# Crate egobox_doe

source ·## Expand description

This library implements some Design of Experiments (DoE) methods a.k.a. sampling methods, specially the Latin Hypercube sampling method which is used by surrogate-based methods. This library is a port of SMT sampling methods.

A DoE method is a way to generate a set of points (i.e. a DoE) within a design (or sample) space `xlimits`

.
The design space is defined as a 2D ndarray `(nx, 2)`

, specifying lower bound and upper bound
of each `nx`

components of the samples `x`

.

Example:

```
use egobox_doe::{FullFactorial, Lhs, LhsKind, Random, SamplingMethod};
use ndarray::{arr2};
use ndarray_rand::rand::SeedableRng;
use rand_xoshiro::Xoshiro256Plus;
// Design space is defined as [5., 10.] x [0., 1.], samples are 2-dimensional.
let xlimits = arr2(&[[5., 10.], [0., 1.]]);
// We generate five samples using centered Latin Hypercube sampling.
let samples = Lhs::new(&xlimits).kind(LhsKind::Centered).sample(5);
// or else with FullFactorial sampling
let samples = FullFactorial::new(&xlimits).sample(5);
// or else randomly with random generator for reproducibility
let samples = Random::new(&xlimits).with_rng(Xoshiro256Plus::seed_from_u64(42)).sample(5);
```

This library contains three kinds of sampling methods:

## Structs§

- The FullFactorial design consists of all possible combinations of levels for all components within the design space.
- The LHS design is built as follows: each dimension space is divided into ns sections where ns is the number of sampling points, and one point in selected in each section. The selection method gives different kind of LHS (see LhsKind)
- The Random design consists in drawing samples randomly.

## Enums§

- Kinds of Latin Hypercube Design

## Traits§

- Sampling method allowing to generate a DoE in a given sample space