Morris

class otmorris.Morris(*args)

Morris method.

Available constructors:

Morris(inputSample, outputSample, interval)

Morris(experiment, model)

Parameters:
inputSampleopenturns.Sample

Experiment generated thanks to the generate method of the MorrisExperiment

outputSampleopenturns.Sample

Response model applied on inputSample

intervalopenturns.Interval

Bounds of the experiment inputs.

experimentotmorris.MorrisExperiment

Morris experiment

modelopenturns.Function

Response model to be applied on input data

Methods

drawElementaryEffects([outputMarginal, ...])

Draw elementary effects.

getClassName()

Accessor to the object's name.

getInputSample()

Accessor to the input sample.

getMeanAbsoluteElementaryEffects([...])

Get the mean of absolute elementary effects.

getMeanElementaryEffects([outputMarginal])

Get the mean of elementary effects.

getName()

Accessor to the object's name.

getOutputSample()

Accessor to the output sample.

getStandardDeviationElementaryEffects([...])

Get the standard deviation of the elementary effects.

hasName()

Test if the object is named.

setName(name)

Accessor to the object's name.

Notes

We note \model:\Rset^{\inputDim} \mapsto \Rset^{\outputDim} the physical model with \model(\vect{x}) = \vect{y}.

The Morris method is a screening method, which is known to be very efficient in case of large number of input parameters (\inputDim \gg 1). It is a qualitative sensitivity analysis method which is based on design of experiments and allows to identify the few important factors at a cost of r \times (\inputDim + 1) simulations. The experiments are of type OAT (One At Time); i.e. only one parameter varies at a time.

The method helps to split input parameters into three groups:

  • Those with negligible effects on the output,

  • Those with significant and linear effects on the output,

  • Those with significant and non linear (or with interactions) effects on the output.

The method relies on input designs defined in the unit hypercube. To sum up the key points of the method, we consider a point named \vect{x}^* in this hypercube and a parameter \delta (parameter of discretization if we consider a regular experiment for example). Starting from the point, we choose randomly one direction by increasing or decreasing one component of the point \vect{x}^* with \delta. Conditionally to this direction, we choose then the \inputDim - 1 directions by randomly selecting one direction at a time. We then get a trajectory (path).

The Morris method is based on the evaluation of elementary effects which are defined as follows:

d_{i}(\vect{x}^k)
= \frac{\model(x_1^k, \ldots, x_{i - 1}^k, x_i^k + \delta, \ldots, x_{\inputDim}^k)
    - \model(x_1^k, \ldots, x_{i - 1}^k, x_i^k, \ldots, x_{\inputDim}^k)}{\delta}

With N trajectories, we get the mean and standard deviation of these effects (we consider the mean of absolute elementary effects in our case). The mean explains the sensitivity whereas the standard deviation explains the interactions and non linear effects.

With the first constructor, we consider that input experiment has been generated thanks to the MorrisExperiment and output is evaluated outside the platform. With the second constructor, the output is evaluated inside the platform.

Examples

>>> import openturns as ot
>>> import otmorris
>>> # Define model
>>> ot.RandomGenerator.SetSeed(1)
>>> b0Random = ot.DistFunc.rNormal()
>>> b1Random = ot.DistFunc.rNormal(10)
>>> b2Random = ot.DistFunc.rNormal(175)
>>> model = otmorris.BuildMorrisFunction(b0Random, b1Random, b2Random)
>>> # Number of trajectories
>>> r = 5
>>> # Define a k-grid level (so delta = 1 / (k - 1))
>>> k = 5
>>> morris_experiment = otmorris.MorrisExperimentGrid([k] * 20, r)
>>> X = morris_experiment.generate()
>>> # Evaluation of the model on the design: evaluation outside OT
>>> Y = model(X)
>>> # need the bounds when using X and Y
>>> bounds = morris_experiment.getBounds()
>>> # Evaluation of Morris effects
>>> morris = otmorris.Morris(X, Y, bounds)
>>> # Get mean/sigma effects
>>> mean_effects = morris.getMeanElementaryEffects()
>>> mean_abs_effects = morris.getMeanAbsoluteElementaryEffects()
>>> sigma_effects = morris.getStandardDeviationElementaryEffects()
__init__(*args)
drawElementaryEffects(outputMarginal=0, absoluteMean=True)

Draw elementary effects.

Plots mean vs standard deviation of elementary effects.

Parameters:
marginalint, optional

Output marginal of interest. Default is 0.

absoluteMeanbool, optional

Whether to use absolute mean. Default is True.

Returns:
graphopenturns.Graph

The elementary effects graph.

getClassName()

Accessor to the object’s name.

Returns:
class_namestr

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

getInputSample()

Accessor to the input sample.

Returns:
inputSampleopenturns.Sample

The input sample.

getMeanAbsoluteElementaryEffects(outputMarginal=0)

Get the mean of absolute elementary effects.

Parameters:
marginalint, optional

Output marginal of interest. Default is 0.

Returns:
meanOfAbsoluteopenturns.Point

The mean of absolute elementary effects.

getMeanElementaryEffects(outputMarginal=0)

Get the mean of elementary effects.

Parameters:
marginalint, optional

Output marginal of interest. Default is 0.

Returns:
meanopenturns.Point

The mean of elementary effects.

getName()

Accessor to the object’s name.

Returns:
namestr

The name of the object.

getOutputSample()

Accessor to the output sample.

Returns:
outputSampleopenturns.Sample

The output sample.

getStandardDeviationElementaryEffects(outputMarginal=0)

Get the standard deviation of the elementary effects.

Parameters:
marginalint, optional

Output marginal of interest. Default is 0.

Returns:
standardDeviationopenturns.Point

The standard deviation of the elementary effects.

hasName()

Test if the object is named.

Returns:
hasNamebool

True if the name is not empty.

setName(name)

Accessor to the object’s name.

Parameters:
namestr

The name of the object.