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

Notes

We note \cM:\Rset^p \mapsto \Rset^q with \cM(\vect{x})= \vect{y}.

The Morris method is a screening method, which is known to be very efficient in case of huge number of input parameters (p >> 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 * (p + 1) simulations. The experiments are of type OAT (One At Time); i.e. only one parameter vary 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 rely on input designs defined in the hypersphere unit. To sum up the key points of the method, we consider a point named \vect{x^*} in this hypersphere 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 increasingslash decreasing one component one component of the point \vect{x^*} with \delta. Conditionnaly to this direction, we choose then the p-1 directions by randomly selecting one direction at time. We get then a trajectory (path).

The Morris method rely on the evaluation of elementary effects which are defined as follow:

d_{i}(\vect{x}^k) = \frac{\cM(x_1^k,\hdots, x_{i-1}^k, x_i^k + \delta,\hdots, x_p^k) - \cM(x_1^k,\hdots, x_{i-1}^k, x_i^k,\hdots, x_p^k)}{\delta}

With N trajectories, we get the mean and standard deviation of these effects (we consider the mean of absolute mean effects in our case). The mean explains the sensitivity wheras 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 second constructor, the output is evaluated inside the platform.

Examples

>>> import openturns as ot
>>> import otmorris
>>> # Define model
>>> ot.RandomGenerator.SetSeed(1)
>>> alpha = ot.DistFunc.rNormal(10)
>>> beta = ot.DistFunc.rNormal(84)
>>> gamma = ot.DistFunc.rNormal(280)
>>> b0 = ot.DistFunc.rNormal()
>>> model = otmorris.MorrisFunction(alpha, beta, gamma, b0)
>>> # 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()

Methods

drawElementaryEffects([outputMarginal, ...])

Draw elementary effects.

getClassName()

Accessor to the object's name.

getId()

Accessor to the object's id.

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.

getShadowedId()

Accessor to the object's shadowed id.

getStandardDeviationElementaryEffects([...])

Get the standard deviation of elementary effects.

getVisibility()

Accessor to the object's visibility state.

hasName()

Test if the object is named.

hasVisibleName()

Test if the object has a distinguishable name.

setName(name)

Accessor to the object's name.

setShadowedId(id)

Accessor to the object's shadowed id.

setVisibility(visible)

Accessor to the object's visibility state.

__init__(*args)
drawElementaryEffects(outputMarginal=0, absoluteMean=True)

Draw elementary effects.

Plots mean vs standard deviation of elementary effects.

Parameters:
marginalint

Output marginal of interest

absoluteMeanbool, default=True

Whether to use absolute mean

Returns:
mean: openturns.Graph

The elementary effects graph

getClassName()

Accessor to the object’s name.

Returns:
class_namestr

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

getId()

Accessor to the object’s id.

Returns:
idint

Internal unique identifier.

getInputSample()

Accessor to the input sample.

Returns:
inputSampleopenturns.Sample

The input sample

getMeanAbsoluteElementaryEffects(outputMarginal=0)

Get the mean of absolute elementary effects.

Parameters:
marginalint

Output marginal of interest

Returns:
mean: openturns.Point

The mean effects.

getMeanElementaryEffects(outputMarginal=0)

Get the mean of elementary effects.

Parameters:
marginalint

Output marginal of interest

Returns:
mean: openturns.Point

The mean effects.

getName()

Accessor to the object’s name.

Returns:
namestr

The name of the object.

getOutputSample()

Accessor to the output sample.

Returns:
inputSampleopenturns.Sample

The output sample

getShadowedId()

Accessor to the object’s shadowed id.

Returns:
idint

Internal unique identifier.

getStandardDeviationElementaryEffects(outputMarginal=0)

Get the standard deviation of elementary effects.

Parameters:
marginalint

Output marginal of interest

Returns:
mean: openturns.Point

The standard effects

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.

hasVisibleName()

Test if the object has a distinguishable name.

Returns:
hasVisibleNamebool

True if the name is not empty and not the default one.

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.

setVisibility(visible)

Accessor to the object’s visibility state.

Parameters:
visiblebool

Visibility flag.