Box

(Source code, png)

../../_images/Box.png
class Box(*args)

Box design of experiments.

Parameters:
levelssequence of int or float

Sequence specifying the number of intermediate points in each direction which regularly discretizes a pavement. In direction i, the points number is levels[i]+2.

boundsInterval, optional

The bounds of the pavement If not specified, the bounds are set to the unit pavement [0,1]^n.

Notes

Box is a stratified design of experiments enabling to create a points grid by regularly discretizing a pavement with the number of intermediate points specified in each direction. The number of points generated is \prod_{i=1}^n (2+levels[i]).

Examples

>>> import openturns as ot
>>> # direction 1 will be discretized in with 4 intermediate points
>>> # and direction 2 with 2 intermediate points
>>> levels = [4, 2]
>>> # first component in [5,7], second in [6,9]
>>> bounds = ot.Interval([5.0, 6.0], [7.0, 9.0])
>>> myGrid = ot.Box(levels, bounds)
>>> mySample = myGrid.generate()

Methods

generate()

Generate points according to the type of the experiment.

getCenter()

Get the center of the stratified experiment.

getClassName()

Accessor to the object's name.

getLevels()

Get the levels of the stratified experiment.

getName()

Accessor to the object's name.

hasName()

Test if the object is named.

setCenter(center)

Set the center of the stratified experiment.

setLevels(levels)

Set the levels of the stratified experiment.

setName(name)

Accessor to the object's name.

__init__(*args)
generate()

Generate points according to the type of the experiment.

Returns:
sampleSample

The points which constitute the design of experiments. The sampling method is defined by the nature of the experiment.

Examples

>>> import openturns as ot
>>> ot.RandomGenerator.SetSeed(0)
>>> myExperiment = ot.Experiment(ot.MonteCarloExperiment(ot.Normal(2),5))
>>> print(myExperiment.generate())
    [ X0        X1        ]
0 : [  0.608202 -1.26617  ]
1 : [ -0.438266  1.20548  ]
2 : [ -2.18139   0.350042 ]
3 : [ -0.355007  1.43725  ]
4 : [  0.810668  0.793156 ]
getCenter()

Get the center of the stratified experiment.

Returns:
centerPoint

Sequence which has different meanings according to the nature of the stratified experiment: Axial, Composite, Factorial or Box (see corresponding documentation).

getClassName()

Accessor to the object’s name.

Returns:
class_namestr

The object class name (object.__class__.__name__).

getLevels()

Get the levels of the stratified experiment.

Returns:
levelsPoint

Sequence which has different meanings according to the nature of the stratified experiment: Axial, Composite, Factorial or Box (see corresponding documentation).

getName()

Accessor to the object’s name.

Returns:
namestr

The name of the object.

hasName()

Test if the object is named.

Returns:
hasNamebool

True if the name is not empty.

setCenter(center)

Set the center of the stratified experiment.

Parameters:
centersequence of float

Sequence which has different meanings according to the nature of the stratified experiment: Axial, Composite, Factorial or Box (see corresponding documentation).

setLevels(levels)

Set the levels of the stratified experiment.

Parameters:
levelssequence of float

Sequence which has different meanings according to the nature of the stratified experiment: Axial, Composite, Factorial or Box (see corresponding documentation).

setName(name)

Accessor to the object’s name.

Parameters:
namestr

The name of the object.

Examples using the class

Draw minimum volume level sets

Draw minimum volume level sets

Kriging: metamodel of the Branin-Hoo function

Kriging: metamodel of the Branin-Hoo function

Use the FORM algorithm in case of several design points

Use the FORM algorithm in case of several design points

Create a domain event

Create a domain event

An illustrated example of a FORM probability estimate

An illustrated example of a FORM probability estimate

Cross Entropy Importance Sampling

Cross Entropy Importance Sampling

Using the FORM - SORM algorithms on a nonlinear function

Using the FORM - SORM algorithms on a nonlinear function

Deterministic design of experiments

Deterministic design of experiments

Create a deterministic design of experiments

Create a deterministic design of experiments

A quick start guide to contours

A quick start guide to contours