MorrisExperimentGrid¶
- class otmorris.MorrisExperimentGrid(*args)¶
MorrisExperimentGrid builds experiments for the Morris method starting from full p-levels grid experiments.
Available constructors:
MorrisExperimentGrid(levels, N)
MorrisExperimentGrid(levels, interval, N)
- Parameters:
- levels
openturns.Indices
Number of levels for a regular grid
- Nint
Number of trajectories
- interval
openturns.Interval
Bounds of the domain
- levels
Notes
With first constructor, we consider that initial experiment is a regular grid defined in . With second constructor, we consider that initial distribution model is uniform with bounds given by the interval argument. Also, the initial experiment is of type regular.
Examples
>>> import openturns as ot >>> import otmorris >>> # Number of trajectories >>> r = 10 >>> # Define a k-grid level (so delta = 1/(k-1)) >>> k = 5 >>> dim = 3 >>> experiment = otmorris.MorrisExperimentGrid([k] * dim, r) >>> X = experiment.generate()
Methods
generate
()Generate points according to the type of the experiment.
generateWithWeights
(weights)Generate points and their associated weight according to the type of the experiment.
Get the bounds of the domain.
Accessor to the object's name.
Accessor to the distribution.
getId
()Accessor to the object's id.
Get the jump step, specifying the number of levels for each factor that are increased/decreased for computing the elementary effects.
getName
()Accessor to the object's name.
Accessor to the object's shadowed id.
getSize
()Accessor to the size of the generated sample.
Accessor to the object's visibility state.
hasName
()Test if the object is named.
Ask whether the experiment has uniform weights.
Test if the object has a distinguishable name.
isRandom
()Accessor to the randomness of quadrature.
setDistribution
(distribution)Accessor to the distribution.
setJumpStep
(jumpStep)Set the jump step, specifying the number of levels for each factor that are increased/decreased for computing the elementary effects.
setName
(name)Accessor to the object's name.
setShadowedId
(id)Accessor to the object's shadowed id.
setSize
(size)Accessor to the size of the generated sample.
setVisibility
(visible)Accessor to the object's visibility state.
- __init__(*args)¶
- generate()¶
Generate points according to the type of the experiment.
- Returns:
- sample
openturns.Sample
Points that constitute the design of experiment, of size
- sample
- generateWithWeights(weights)¶
Generate points and their associated weight according to the type of the experiment.
- Returns:
Examples
>>> import openturns as ot >>> ot.RandomGenerator.SetSeed(0) >>> myExperiment = ot.MonteCarloExperiment(ot.Normal(2), 5) >>> sample, weights = myExperiment.generateWithWeights() >>> print(sample) [ 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 ] >>> print(weights) [0.2,0.2,0.2,0.2,0.2]
- getBounds()¶
Get the bounds of the domain.
- Returns:
- bounds
openturns.Interval
Bounds of the domain, default is
- bounds
- getClassName()¶
Accessor to the object’s name.
- Returns:
- class_namestr
The object class name (object.__class__.__name__).
- getDistribution()¶
Accessor to the distribution.
- Returns:
- distribution
Distribution
Distribution used to generate the set of input data.
- distribution
- getId()¶
Accessor to the object’s id.
- Returns:
- idint
Internal unique identifier.
- getJumpStep()¶
Get the jump step, specifying the number of levels for each factor that are increased/decreased for computing the elementary effects. If not given, it is set to 1 for each factor.
- Returns:
- humpStep
openturns.Indices
Number of levels for each factot that are increased/decreased for computating the EE.
- humpStep
- getName()¶
Accessor to the object’s name.
- Returns:
- namestr
The name of the object.
- getShadowedId()¶
Accessor to the object’s shadowed id.
- Returns:
- idint
Internal unique identifier.
- getSize()¶
Accessor to the size of the generated sample.
- Returns:
- sizepositive int
Number of points constituting the design of experiments.
- getVisibility()¶
Accessor to the object’s visibility state.
- Returns:
- visiblebool
Visibility flag.
- hasName()¶
Test if the object is named.
- Returns:
- hasNamebool
True if the name is not empty.
- hasUniformWeights()¶
Ask whether the experiment has uniform weights.
- Returns:
- hasUniformWeightsbool
Whether the experiment has uniform weights.
- hasVisibleName()¶
Test if the object has a distinguishable name.
- Returns:
- hasVisibleNamebool
True if the name is not empty and not the default one.
- isRandom()¶
Accessor to the randomness of quadrature.
- Parameters:
- isRandombool
Is true if the design of experiments is random. Otherwise, the design of experiment is assumed to be deterministic.
- setDistribution(distribution)¶
Accessor to the distribution.
- Parameters:
- distribution
Distribution
Distribution used to generate the set of input data.
- distribution
- setJumpStep(jumpStep)¶
Set the jump step, specifying the number of levels for each factor that are increased/decreased for computing the elementary effects. If not given, it is set to 1 for each factor.
- Parameters:
- humpStep
openturns.Indices
Number of levels for each factot that are increased/decreased for computating the EE.
- humpStep
Notes
The final jump step contains only integers, so the parameter argument is converted into a list of integer thanks to the floor operator.
- setName(name)¶
Accessor to the object’s name.
- Parameters:
- namestr
The name of the object.
- setShadowedId(id)¶
Accessor to the object’s shadowed id.
- Parameters:
- idint
Internal unique identifier.
- setSize(size)¶
Accessor to the size of the generated sample.
- Parameters:
- sizepositive int
Number of points constituting the design of experiments.
- setVisibility(visible)¶
Accessor to the object’s visibility state.
- Parameters:
- visiblebool
Visibility flag.