FunctionalChaosAnalysis

class persalys.FunctionalChaosAnalysis(*args)

Create a Functional chaos analysis.

Parameters:

name : str

Name

designOfExperiment : DesignOfExperiment

Design of experiments

Examples

>>> import openturns as ot
>>> import persalys

Create the model:

>>> from math import pi
>>> ot.RandomGenerator.SetSeed(0)
>>> xi1 = persalys.Input('xi1', ot.Uniform(-pi, pi))
>>> xi2 = persalys.Input('xi2', ot.Uniform(-pi, pi))
>>> xi3 = persalys.Input('xi3', ot.Uniform(-pi, pi))
>>> y0 = persalys.Output('y0')
>>> myPhysicalModel = persalys.SymbolicPhysicalModel('myPhysicalModel', [xi1, xi2, xi3], [y0], ['sin(xi1) + 7. * (sin(xi2)) ^ 2 + 0.1 * xi3^4 * sin(xi1)'])

Create the design of experiments:

>>> aDesign = persalys.FixedDesignOfExperiment('aDesign', myPhysicalModel)
>>> inputSample = ot.LHSExperiment(myPhysicalModel.getDistribution(), 250).generate()
>>> aDesign.setOriginalInputSample(inputSample)
>>> aDesign.run()

Create the Functional Chaos Analysis:

>>> chaos = persalys.FunctionalChaosAnalysis('chaos', aDesign)
>>> chaos.setChaosDegree(6)
>>> chaos.setSparseChaos(False)
>>> chaos.setLeaveOneOutValidation(False)
>>> chaos.run()

Get the result:

>>> chaosResult = chaos.getResult()
>>> sobolResult = chaosResult.getSobolResult()

Methods

analyticalValidation() Whether an analytical validation is requested.
getChaosDegree() Chaos degree accessor.
getClassName() Accessor to the object’s name.
getDesignOfExperiment() Design of experiments accessor.
getDistribution() Input distribution accessor.
getEffectiveInputSample() Effective input sample accessor.
getEffectiveOutputSample() Effective output sample accessor.
getErrorMessage() Error message accessor.
getId() Accessor to the object’s id.
getInterestVariables() Get the variables to analyse.
getKFoldValidationNumberOfFolds() Number of folds accessor.
getKFoldValidationSeed() Seed accessor.
getName() Accessor to the object’s name.
getPythonScript() Physical model accessor.
getResult() Results accessor.
getShadowedId() Accessor to the object’s shadowed id.
getSparseChaos() Whether it is sparse.
getTestSampleValidationPercentageOfPoints() Percentage of points accessor.
getTestSampleValidationSeed() Seed accessor.
getVisibility() Accessor to the object’s visibility state.
getWarningMessage() Warning message accessor.
hasName() Test if the object is named.
hasValidResult() Whether the analysis has been run.
hasVisibleName() Test if the object has a distinguishable name.
isReliabilityAnalysis() Whether the analysis involves reliability.
isRunning() Whether the analysis is running.
kFoldValidation() Whether a k-Fold cross-validation is requested.
leaveOneOutValidation() Whether a validation by leave-one-out is requested.
run() Launch the analysis.
setAnalyticalValidation(validation) Whether an analytical validation is requested.
setChaosDegree(degree) Chaos degree accessor.
setInterestVariables(variablesNames) Set the variables to analyse.
setKFoldValidation(validation) Whether a k-Fold cross-validation is requested.
setKFoldValidationNumberOfFolds(nbFolds) Number of folds accessor.
setKFoldValidationSeed(seed) Seed accessor.
setLeaveOneOutValidation(validation) Whether it is sparse.
setName(name) Accessor to the object’s name.
setShadowedId(id) Accessor to the object’s shadowed id.
setSparseChaos(sparse) Whether it is sparse.
setTestSampleValidation(validation) Whether a validation with a test sample is requested.
setTestSampleValidationPercentageOfPoints(…) Percentage of points accessor.
setTestSampleValidationSeed(seed) Seed accessor.
setVisibility(visible) Accessor to the object’s visibility state.
testSampleValidation() Whether a validation with a test sample is requested.
__init__(*args)
analyticalValidation()

Whether an analytical validation is requested.

Returns:

validation : bool

Whether an analytical validation is requested. This method corresponds to an approximation of the Leave-one-out method result.

getChaosDegree()

Chaos degree accessor.

Returns:

degree : int

Chaos degree. It is set by default to 2

getClassName()

Accessor to the object’s name.

Returns:

class_name : str

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

getDesignOfExperiment()

Design of experiments accessor.

Returns:

model : DesignOfExperiment

Design of experiments

getDistribution()

Input distribution accessor.

Returns:

distribution : openturns.ComposedDistribution

The distribution defined in the probabilistic model or a distribution composed of Uniform laws if there is no stochastic input variable.

getEffectiveInputSample()

Effective input sample accessor.

Returns:

sample : openturns.Sample

Sample of all the input variables if all of them are deterministic. Otherwise, sample of the stochastic input variables.

getEffectiveOutputSample()

Effective output sample accessor.

Returns:

sample : openturns.Sample

Sample of the interest output variables.

getErrorMessage()

Error message accessor.

Returns:

message : str

Error message if the analysis failed

getId()

Accessor to the object’s id.

Returns:

id : int

Internal unique identifier.

getInterestVariables()

Get the variables to analyse.

Returns:

variablesNames : sequence of str

Names of the variables to analyse

getKFoldValidationNumberOfFolds()

Number of folds accessor.

Returns:

folds : int

Number of folds. By default it is 3.

getKFoldValidationSeed()

Seed accessor.

Returns:

seed : int

Seed value for k-Fold cross-validation

getName()

Accessor to the object’s name.

Returns:

name : str

The name of the object.

getPythonScript()

Physical model accessor.

Returns:

script : str

Python script to replay the analysis

getResult()

Results accessor.

Returns:

result : FunctionalChaosAnalysisResult

Results

getShadowedId()

Accessor to the object’s shadowed id.

Returns:

id : int

Internal unique identifier.

getSparseChaos()

Whether it is sparse.

Returns:

isSparse : bool

Whether it is sparse. By default, the chaos is not sparse

getTestSampleValidationPercentageOfPoints()

Percentage of points accessor.

Returns:

percentage : int

Percentage of points used to validate the metamodel. By default it is 20%.

getTestSampleValidationSeed()

Seed accessor.

Returns:

seed : int

Seed value for the validation with a test sample

getVisibility()

Accessor to the object’s visibility state.

Returns:

visible : bool

Visibility flag.

getWarningMessage()

Warning message accessor.

Returns:

message : str

Warning message which can appear during the analysis computation

hasName()

Test if the object is named.

Returns:

hasName : bool

True if the name is not empty.

hasValidResult()

Whether the analysis has been run.

Returns:

hasValidResult : bool

Whether the analysis has already been run

hasVisibleName()

Test if the object has a distinguishable name.

Returns:

hasVisibleName : bool

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

isReliabilityAnalysis()

Whether the analysis involves reliability.

Returns:

isReliabilityAnalysis : bool

Whether the analysis involves a reliability analysis

isRunning()

Whether the analysis is running.

Returns:

isRunning : bool

Whether the analysis is running

kFoldValidation()

Whether a k-Fold cross-validation is requested.

Returns:

validation : bool

Whether a k-Fold cross-validation is requested

leaveOneOutValidation()

Whether a validation by leave-one-out is requested.

Returns:

validation : bool

Whether a validation by leave-one-out is requested

run()

Launch the analysis.

setAnalyticalValidation(validation)

Whether an analytical validation is requested.

Parameters:

validation : bool

Whether an analytical validation is requested. This method corresponds to an approximation of the Leave-one-out method result.

setChaosDegree(degree)

Chaos degree accessor.

Parameters:

degree : int

Chaos degree

setInterestVariables(variablesNames)

Set the variables to analyse.

Parameters:

variablesNames : sequence of str

Names of the variables to analyse

setKFoldValidation(validation)

Whether a k-Fold cross-validation is requested.

Parameters:

validation : bool

Whether a k-Fold cross-validation is requested

setKFoldValidationNumberOfFolds(nbFolds)

Number of folds accessor.

Parameters:

folds : int

Number of folds. By default it is 3.

setKFoldValidationSeed(seed)

Seed accessor.

Parameters:

seed : int

Seed value for k-Fold cross-validation

setLeaveOneOutValidation(validation)

Whether it is sparse.

Parameters:

validation : bool

Whether a validation by leave-one-out is requested

setName(name)

Accessor to the object’s name.

Parameters:

name : str

The name of the object.

setShadowedId(id)

Accessor to the object’s shadowed id.

Parameters:

id : int

Internal unique identifier.

setSparseChaos(sparse)

Whether it is sparse.

Parameters:

isSparse : bool

Whether it is sparse

setTestSampleValidation(validation)

Whether a validation with a test sample is requested.

Parameters:

validation : bool

Whether a validation with a test sample is requested. The data sample is dividing into two sub-samples: a training sample (default: 80% of the sample points) and a test sample (default: 20% of the sample points). A new metamodel is built with the training sample and is validated with the test sample. The points are randomly picked in the data sample (by default the seed is 1).

setTestSampleValidationPercentageOfPoints(percentage)

Percentage of points accessor.

Parameters:

percentage : int

Percentage of points used to validate the metamodel. By default it is 20%.

setTestSampleValidationSeed(seed)

Seed accessor.

Parameters:

seed : int

Seed value for the validation with a test sample

setVisibility(visible)

Accessor to the object’s visibility state.

Parameters:

visible : bool

Visibility flag.

testSampleValidation()

Whether a validation with a test sample is requested.

Returns:

validation : bool

Whether a validation with a test sample is requested. The data sample is dividing into two sub-samples: a training sample (default: 80% of the sample points) and a test sample (default: 20% of the sample points). A new metamodel is built with the training sample and is validated with the test sample. The points are randomly picked in the data sample (by default the seed is 1).