PolynomialChaosPOD

class PolynomialChaosPOD(*args)

Polynomial chaos based POD.

Available constructor:

PolynomialChaosPOD(inputSample, outputSample, detection, noiseThres, saturationThres, boxCox)

Parameters
inputSample2-d sequence of float

Vector of the input values. The first column must correspond with the defect sizes.

outputSample2-d sequence of float

Vector of the signals, of dimension 1.

detectionfloat

Detection value of the signal.

noiseThresfloat

Value for low censored data. Default is None.

saturationThresfloat

Value for high censored data. Default is None

boxCoxbool or float

Enable or not the Box Cox transformation. If boxCox is a float, the Box Cox transformation is enabled with the given value. Default is False.

Warning

The first column of the input sample must corresponds with the defects sample.

Notes

This class aims at building the POD based on a polynomial chaos model. This method must be used under the assumption that the residuals follows a Normal distribution.

The return POD model corresponds with an interpolate function built with the POD values computed for the given defect sizes. The default values are 20 defect sizes between the minimum and maximum value of the defect sample. The defect sizes can be changed using the method setDefectSizes.

The default polynomial chaos model is built with uniform distributions for each parameters. Coefficients are computed using the LAR algorithm combined with the KFold. The AdaptiveStrategy is chosen fixed with a linear enumerate function of maximum degree 3.

For advanced use, all parameters can be defined thanks to dedicated set methods. Moreover, if the user has already built a polynomial chaos result, it can be given as parameter using the method setPolynomialChaosResult, then the POD is computed based on this polynomial chaos result.

A progress bar is shown if the verbosity is enabled. It can be disabled using the method setVerbose.

Methods

computeDetectionSize(self, probabilityLevel)

Compute the detection size for a given probability level.

drawBoxCoxLikelihood(self[, name])

Draw the loglikelihood versus the Box Cox parameter.

drawPOD(self[, probabilityLevel, …])

Draw the POD curve.

drawPolynomialChaosModel(self[, name])

Draw the polynomial chaos prediction versus the true data.

drawValidationGraph(self[, name])

Draw the validation graph of the metamodel.

getAdaptiveStrategy(self)

Accessor to the adaptive strategy.

getBoxCoxParameter(self)

Accessor to the Box Cox parameter.

getCoefficientDistribution(self)

Accessor to the distribution of the polynomial chaos coefficients.

getDefectSizes(self)

Accessor to the defect size where POD is computed.

getDegree(self)

Accessor to the polynomial chaos degree.

getDistribution(self)

Accessor to the parameters distribution.

getPODCLModel(self[, confidenceLevel])

Accessor to the POD model at a given confidence level.

getPODModel(self)

Accessor to the POD model.

getPolynomialChaosResult(self)

Accessor to the polynomial chaos result.

getProjectionStrategy(self)

Accessor to the projection strategy.

getQ2(self)

Accessor to the Q2 value.

getR2(self)

Accessor to the R2 value.

getSamplingSize(self)

Accessor to the Monte Carlo sampling size.

getSimulationSize(self)

Accessor to the simulation size.

getVerbose(self)

Accessor to the verbosity.

run(self)

Build the POD models.

setAdaptiveStrategy(self, strategy)

Accessor to the adaptive strategy.

setDefectSizes(self, size)

Accessor to the defect size where POD is computed.

setDegree(self, degree)

Accessor to the polynomial chaos degree.

setDistribution(self, distribution)

Accessor to the parameters distribution.

setPolynomialChaosResult(self, chaosResult)

Accessor to the polynomial chaos result.

setProjectionStrategy(self, strategy)

Accessor to the projection strategy.

setSamplingSize(self, size)

Accessor to the Monte Carlo sampling size.

setSimulationSize(self, size)

Accessor to the simulation size.

setVerbose(self, verbose)

Accessor to the verbosity.

computeDetectionSize(self, probabilityLevel, confidenceLevel=None)

Compute the detection size for a given probability level.

Parameters
probabilityLevelfloat

The probability level for which the defect size is computed.

confidenceLevelfloat

The confidence level associated to the given probability level the defect size is computed. Default is None.

Returns
resultcollection of openturns.PointWithDescription

A PointWithDescription containing the detection size computed at the given probability level and confidence level if provided.

drawBoxCoxLikelihood(self, name=None)

Draw the loglikelihood versus the Box Cox parameter.

Parameters
namestring

name of the figure to be saved with transparent option sets to True and bbox_inches=’tight’. It can be only the file name or the full path name. Default is None.

Returns
figmatplotlib.figure

Matplotlib figure object.

axmatplotlib.axes

Matplotlib axes object.

Notes

This method is available only when the parameter boxCox is set to True.

drawPOD(self, probabilityLevel=None, confidenceLevel=None, defectMin=None, defectMax=None, nbPt=100, name=None)

Draw the POD curve.

Parameters
probabilityLevelfloat

The probability level for which the defect size is computed. Default is None.

confidenceLevelfloat

The confidence level associated to the given probability level the defect size is computed. Default is None.

defectMin, defectMaxfloat

Define the interval where the curve is plotted. Default : min and max values of the input sample.

nbPtint

The number of points to draw the curves. Default is 100.

namestring

name of the figure to be saved with transparent option sets to True and bbox_inches=’tight’. It can be only the file name or the full path name. Default is None.

Returns
figmatplotlib.figure

Matplotlib figure object.

axmatplotlib.axes

Matplotlib axes object.

drawPolynomialChaosModel(self, name=None)

Draw the polynomial chaos prediction versus the true data.

Parameters
namestring

name of the figure to be saved with transparent option sets to True and bbox_inches=’tight’. It can be only the file name or the full path name. Default is None.

Returns
figmatplotlib.figure

Matplotlib figure object.

axmatplotlib.axes

Matplotlib axes object.

Notes

This method only works if the dimension of the input sample is 1.

drawValidationGraph(self, name=None)

Draw the validation graph of the metamodel.

Parameters
namestring

name of the figure to be saved with transparent option sets to True and bbox_inches=’tight’. It can be only the file name or the full path name. Default is None.

Returns
figmatplotlib.figure

Matplotlib figure object.

axmatplotlib.axes

Matplotlib axes object.

getAdaptiveStrategy(self)

Accessor to the adaptive strategy.

Returns
strategyopenturns.AdaptiveStrategy

The adaptive strategy for the polynomial chaos.

getBoxCoxParameter(self)

Accessor to the Box Cox parameter.

Returns
lambdaBoxCoxfloat

The Box Cox parameter used to transform the data. If the transformation is not enabled None is returned.

getCoefficientDistribution(self)

Accessor to the distribution of the polynomial chaos coefficients.

Returns
distopenturns.Distribution

The distribution of the coefficients.

getDefectSizes(self)

Accessor to the defect size where POD is computed.

Returns
defectSizesequence of float

The defect sizes where the Monte Carlo simulation is performed to compute the POD.

getDegree(self)

Accessor to the polynomial chaos degree.

Returns
degreeint

The degree of the polynomial chaos.

getDistribution(self)

Accessor to the parameters distribution.

Returns
distributionopenturns.ComposedDistribution

The input parameters distribution, default is a Uniform distribution for all parameters.

getPODCLModel(self, confidenceLevel=0.95)

Accessor to the POD model at a given confidence level.

Parameters
confidenceLevelfloat

The confidence level the POD must be computed. Default is 0.95

Returns
PODModelClopenturns.Function

The function which computes the probability of detection for a given defect value at the confidence level given as parameter.

getPODModel(self)

Accessor to the POD model.

Returns
PODModelopenturns.Function

The function which computes the probability of detection for a given defect value.

getPolynomialChaosResult(self)

Accessor to the polynomial chaos result.

Returns
resultopenturns.FunctionalChaosResult

The polynomial chaos result.

getProjectionStrategy(self)

Accessor to the projection strategy.

Returns
strategyopenturns.ProjectionStrategy

The projection strategy for the polynomial chaos.

getQ2(self)

Accessor to the Q2 value.

Returns
Q2float

The Q2 value computed analytically.

getR2(self)

Accessor to the R2 value.

Returns
R2float

The R2 value.

getSamplingSize(self)

Accessor to the Monte Carlo sampling size.

Returns
sizeint

The size of the Monte Carlo simulation used to compute the POD for each defect size.

getSimulationSize(self)

Accessor to the simulation size.

Returns
sizeint

The size of the simulation used to compute the confidence interval.

getVerbose(self)

Accessor to the verbosity.

Returns
verbosebool

Enable or disable the verbosity. Default is True.

run(self)

Build the POD models.

Notes

This method build the polynomial chaos model. First the censored data are filtered if needed. The Box Cox transformation is performed if it is enabled. Then it builds the POD models, the Monte Carlo simulation is performed for each given defect sizes. The confidence interval is computed by simulating new coefficients of the polynomial chaos, then Monte Carlo simulations are performed.

setAdaptiveStrategy(self, strategy)

Accessor to the adaptive strategy.

Parameters
strategyopenturns.AdaptiveStrategy

The adaptive strategy for the polynomial chaos.

setDefectSizes(self, size)

Accessor to the defect size where POD is computed.

Parameters
defectSizesequence of float

The defect sizes where the Monte Carlo simulation is performed to compute the POD.

setDegree(self, degree)

Accessor to the polynomial chaos degree.

Parameters
degreeint

The degree of the polynomial chaos.

setDistribution(self, distribution)

Accessor to the parameters distribution.

Parameters
distributionopenturns.ComposedDistribution

The input parameters distribution.

setPolynomialChaosResult(self, chaosResult)

Accessor to the polynomial chaos result.

Parameters
chaosResultopenturns.FunctionalChaosResult

The polynomial chaos result.

setProjectionStrategy(self, strategy)

Accessor to the projection strategy.

Parameters
strategyopenturns.ProjectionStrategy

The projection strategy for the polynomial chaos.

setSamplingSize(self, size)

Accessor to the Monte Carlo sampling size.

Parameters
sizeint

The size of the Monte Carlo simulation used to compute the POD for each defect size.

setSimulationSize(self, size)

Accessor to the simulation size.

Parameters
sizeint

The size of the simulation used to compute the confidence interval.

setVerbose(self, verbose)

Accessor to the verbosity.

Parameters
verbosebool

Enable or disable the verbosity.