CalibrationAnalysis

class persalys.CalibrationAnalysis(*args)

Run a calibration analysis.

Parameters:
namestr

Name

observationsObservations

Observations of at least one input and one output

Examples

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

Create the Chaboche model:

>>> R = persalys.Input('R', 700e6, ot.LogNormalMuSigma(750e6, 11e6).getDistribution(), 'Parameter R')
>>> C = persalys.Input('C', 2500e6, ot.Normal(2750e6, 250e6), 'Parameter C')
>>> gamma = persalys.Input('gam', 8., ot.Normal(10, 2), 'Parameter gamma')
>>> dist_strain = ot.Uniform(0, 0.07)
>>> strain = persalys.Input('strain', 0., dist_strain, 'Strain')
>>> sigma = persalys.Output('sigma', 'Stress (Pa)')
>>> model = persalys.SymbolicPhysicalModel('model1', [R, C, gamma, strain], [sigma], ['R + C / gam * (1 - exp(-gam * strain))'])

Generate observations:

>>> nbObs = 100
>>> strainObs = dist_strain.getSample(nbObs)
>>> strainObs.setDescription(['strain'])
>>> stressSampleNoise = ot.Normal(0., 40.e6).getSample(nbObs)
>>> stressSample = ot.ParametricFunction(model.getFunction(), [0, 1, 2], [750e6, 2750e6, 10.])(strainObs)
>>> stressObs = stressSample + stressSampleNoise
>>> observations = persalys.Observations('obs1', model, strainObs, stressObs)

Process a calibration analysis:

>>> analysis = persalys.CalibrationAnalysis('myAnalysis', observations)
>>> analysis.run()

Get the result:

>>> result = analysis.getResult()
>>> thetaStar = result.getCalibrationResult().getParameterMAP()

Methods

GetMethodNames()

Get the list of available method names.

getBootStrapSize()

Accessor to the bootstrap size used to sample the posterior distribution.

getCalibratedInputs()

Inputs to calibrate accessor.

getClassName()

Accessor to the object's name.

getConfidenceIntervalLength()

Confidence interval length accessor.

getErrorCovariance()

Accessor to the output observations error covariance.

getErrorMessage()

Error message accessor.

getFixedInputs()

Fixed inputs accessor.

getId()

Accessor to the object's id.

getInterestVariables()

Get the variables to analyse.

getMethodName()

Accessor to the method name

getName()

Accessor to the object's name.

getObservations()

Accessor to the data to be fitted.

getOptimizationAlgorithm()

Accessor to the optimization algorithm used by non linear algorithms.

getPhysicalModel()

Physical model accessor.

getPriorDistribution()

Accessor to the prior distribution.

getPythonScript()

Physical model accessor.

getResult()

Result accessor.

getShadowedId()

Accessor to the object's shadowed id.

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.

run()

Launch the analysis.

setBootStrapSize(arg2)

Accessor to the bootstrap size used to sample the posterior distribution.

setCalibratedInputs(*args)

Accessor to the inputs to calibrate and the fixed inputs.

setConfidenceIntervalLength(arg2)

Confidence interval length accessor.

setErrorCovariance(matrix)

Accessor to the output observations error covariance.

setInterestVariables(variablesNames)

Set the variables to analyse.

setMethodName(name)

Accessor to the method name

setName(name)

Accessor to the object's name.

setOptimizationAlgorithm(solver)

Accessor to the optimization algorithm used by non linear algorithms.

setShadowedId(id)

Accessor to the object's shadowed id.

setVisibility(visible)

Accessor to the object's visibility state.

canBeLaunched

getElapsedTime

getParentObserver

__init__(*args)
static GetMethodNames()

Get the list of available method names.

Returns:
namesDescription

List of available calibration method names.

getBootStrapSize()

Accessor to the bootstrap size used to sample the posterior distribution.

Returns:
sizeint

Bootstrap size used to sample the posterior distribution by the non linear algorithms. A value of 0 means that no bootstrap has been done but a linear approximation has been used to get the posterior distribution, using the GaussianLinearCalibration or LinearLeastSquaresCalibration algorithm at the maximum a posteriori estimate. The value 1 is not allowed at this time.

getCalibratedInputs()

Inputs to calibrate accessor.

Returns:
inputsopenturns.Description

Names of the input variables to calibrate

getClassName()

Accessor to the object’s name.

Returns:
class_namestr

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

getConfidenceIntervalLength()

Confidence interval length accessor.

Returns:
lengthfloat

Length of the confidence interval of the posterior distribution. It is set by default to 0.95.

getErrorCovariance()

Accessor to the output observations error covariance.

Returns:
matrixopenturns.CovarianceMatrix

The covariance matrix of the gaussian distribution of the output observations error. Used by the gaussian algorithms.

getErrorMessage()

Error message accessor.

Returns:
messagestr

Error message if the analysis failed

getFixedInputs()

Fixed inputs accessor.

Returns:
inputsopenturns.PointWithDescription

Fixed input names and values

getId()

Accessor to the object’s id.

Returns:
idint

Internal unique identifier.

getInterestVariables()

Get the variables to analyse.

Returns:
variablesNamessequence of str

Names of the variables to analyse

getMethodName()

Accessor to the method name

Returns:
methodstr

Method name. Default is ‘LeastSquaresLinear’. Use GetMethodNames() to list available names.

getName()

Accessor to the object’s name.

Returns:
namestr

The name of the object.

getObservations()

Accessor to the data to be fitted.

Returns:
dataSample

The data to be fitted.

getOptimizationAlgorithm()

Accessor to the optimization algorithm used by non linear algorithms.

Returns:
algorithmopenturns.OptimizationAlgorithm

Optimization algorithm used by non linear algorithms. The optimization problem and the starting point are not taken into account.

getPhysicalModel()

Physical model accessor.

Returns:
modelPhysicalModel

Physical model

getPriorDistribution()

Accessor to the prior distribution.

Returns:
distributionopenturns.Distribution

Prior distribution

getPythonScript()

Physical model accessor.

Returns:
scriptstr

Python script to replay the analysis

getResult()

Result accessor.

Returns:
resultCalibrationAnalysisResult

Result

getShadowedId()

Accessor to the object’s shadowed id.

Returns:
idint

Internal unique identifier.

getVisibility()

Accessor to the object’s visibility state.

Returns:
visiblebool

Visibility flag.

getWarningMessage()

Warning message accessor.

Returns:
messagestr

Warning message which can appear during the analysis computation

hasName()

Test if the object is named.

Returns:
hasNamebool

True if the name is not empty.

hasValidResult()

Whether the analysis has been run.

Returns:
hasValidResultbool

Whether the analysis has already been run

hasVisibleName()

Test if the object has a distinguishable name.

Returns:
hasVisibleNamebool

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

isReliabilityAnalysis()

Whether the analysis involves reliability.

Returns:
isReliabilityAnalysisbool

Whether the analysis involves a reliability analysis

isRunning()

Whether the analysis is running.

Returns:
isRunningbool

Whether the analysis is running

run()

Launch the analysis.

setBootStrapSize(arg2)

Accessor to the bootstrap size used to sample the posterior distribution.

Parameters:
sizeint

Bootstrap size used to sample the posterior distribution by the non linear algorithms. A value of 0 means that no bootstrap has been done but a linear approximation has been used to get the posterior distribution, using the GaussianLinearCalibration or LinearLeastSquaresCalibration algorithm at the maximum a posteriori estimate. The value 1 is not allowed at this time.

setCalibratedInputs(*args)

Accessor to the inputs to calibrate and the fixed inputs.

Parameters:
calibratedInputsequence of str

Names of the input variables to calibrate

priorDistributionopenturns.Distribution

Prior distribution. Its dimension must equal to the number of variables to calibrate

fixedInputssequence of str, optional

Names of the input variables to fix

valuessequence of float, optional

Values of the fixed inputs

setConfidenceIntervalLength(arg2)

Confidence interval length accessor.

Parameters:
lengthfloat

Length of the confidence interval of the posterior distribution. It is set by default to 0.95.

setErrorCovariance(matrix)

Accessor to the output observations error covariance.

Parameters:
matrixopenturns.CovarianceMatrix

The covariance matrix of the gaussian distribution of the output observations error. Used by the gaussian algorithms.

setInterestVariables(variablesNames)

Set the variables to analyse.

Parameters:
variablesNamessequence of str

Names of the variables to analyse

setMethodName(name)

Accessor to the method name

Parameters:
methodstr

Method name. Default is ‘LeastSquaresLinear’. Use GetMethodNames() to list available names.

setName(name)

Accessor to the object’s name.

Parameters:
namestr

The name of the object.

setOptimizationAlgorithm(solver)

Accessor to the optimization algorithm used by non linear algorithms.

Parameters:
algorithmopenturns.OptimizationAlgorithm

Optimization algorithm used by non linear algorithms. The optimization problem and the starting point are not taken into account.

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.