LeastSquaresStrategy

class LeastSquaresStrategy(*args)

Least squares strategy for the approximation coefficients.

Available constructors:

LeastSquaresStrategy(weightedExp)

LeastSquaresStrategy(weightedExp, approxAlgoImpFact)

LeastSquaresStrategy(approxAlgoImpFact)

LeastSquaresStrategy(measure, approxAlgoImpFact)

LeastSquaresStrategy(measure, weightedExp, approxAlgoImpFact)

LeastSquaresStrategy(inputSample, outputSample, approxAlgoImpFact)

LeastSquaresStrategy(inputSample, weights, outputSample, approxAlgoImpFact)

Parameters:
weightedExpWeightedExperiment

Experimental design used for the transformed input data.

By default, the class MonteCarloExperiment is used.

approxAlgoImpFactApproximationAlgorithmImplementationFactory

The factory that builds the desired ApproximationAlgorithm.

By default, the class PenalizedLeastSquaresAlgorithmFactory is used.

measureDistribution

The input distribution \mu_{\inputRV}.

By default, the limit measure defined within the class WeightedExperiment is used.

inputSample2-d sequence of float

The input sample of size \sampleSize.

outputSample2-d sequence of float

The output sample of size \sampleSize.

weightssequence of float

Numerical point that are the weights associated to the input sample points such that the corresponding weighted experiment is a good approximation of \mu_{\inputRV}.

By default, all weights are equal to \omega_i = \frac{1}{\sampleSize}.

Methods

getClassName()

Accessor to the object's name.

getCoefficients()

Accessor to the coefficients.

getDesignProxy()

Accessor to the design proxy.

getExperiment()

Accessor to the experiments.

getInputSample()

Accessor to the input sample.

getMeasure()

Accessor to the measure.

getName()

Accessor to the object's name.

getOutputSample()

Accessor to the output sample.

getRelativeError()

Accessor to the relative error.

getResidual()

Accessor to the residual.

getWeights()

Accessor to the weights.

hasName()

Test if the object is named.

involvesModelSelection()

Get the model selection flag.

isLeastSquares()

Get the least squares flag.

setExperiment(weightedExperiment)

Accessor to the design of experiment.

setInputSample(inputSample)

Accessor to the input sample.

setMeasure(measure)

Accessor to the measure.

setName(name)

Accessor to the object's name.

setOutputSample(outputSample)

Accessor to the output sample.

setWeights(weights)

Accessor to the weights.

Notes

This class is used in the functional chaos expansion context implemented in the class FunctionalChaosAlgorithm. It is not usable outside this context.

The model is approximated by the meta model defined in Functional Chaos Expansion by equation (5) and the coefficients (a_k)_{k \in I_n} are computed by solving the least squares problem defined in Functional Chaos Expansion by equation (6).

Refer to Least squares meta models for more details on the resolution of least-squares problem.

__init__(*args)
getClassName()

Accessor to the object’s name.

Returns:
class_namestr

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

getCoefficients()

Accessor to the coefficients.

Returns:
coefPoint

Coefficients (\alpha_k)_{k \in I_n}.

getDesignProxy()

Accessor to the design proxy.

Parameters:
designProxyDesignProxy

The design matrix.

getExperiment()

Accessor to the experiments.

Returns:
expWeightedExperiment

Weighted experiment used to evaluate the coefficients.

getInputSample()

Accessor to the input sample.

Returns:
XSample

Input Sample.

getMeasure()

Accessor to the measure.

Returns:
muDistribution

Measure \mu_{\inputRV} defining the inner product.

getName()

Accessor to the object’s name.

Returns:
namestr

The name of the object.

getOutputSample()

Accessor to the output sample.

Returns:
YSample

Output Sample.

getRelativeError()

Accessor to the relative error.

Returns:
efloat

Relative error.

getResidual()

Accessor to the residual.

Returns:
erfloat

Residual error.

getWeights()

Accessor to the weights.

Returns:
wPoint

Weights of the design of experiments.

hasName()

Test if the object is named.

Returns:
hasNamebool

True if the name is not empty.

involvesModelSelection()

Get the model selection flag.

A model selection method can be used to select the coefficients of the decomposition which enable to best predict the output. Model selection can lead to a sparse functional chaos expansion.

Returns:
involvesModelSelectionbool

True if the method involves a model selection method.

isLeastSquares()

Get the least squares flag.

There are two methods to compute the coefficients: integration or least squares.

Returns:
isLeastSquaresbool

True if the coefficients are estimated from least squares.

setExperiment(weightedExperiment)

Accessor to the design of experiment.

Parameters:
expWeightedExperiment

Weighted design of experiment.

setInputSample(inputSample)

Accessor to the input sample.

Parameters:
XSample

Input Sample.

setMeasure(measure)

Accessor to the measure.

Parameters:
mDistribution

Measure \mu_{\inputRV} defining the scalar product.

setName(name)

Accessor to the object’s name.

Parameters:
namestr

The name of the object.

setOutputSample(outputSample)

Accessor to the output sample.

Parameters:
YSample

Output Sample.

setWeights(weights)

Accessor to the weights.

Parameters:
wPoint

Weights of the design of experiments.

Examples using the class

Compute leave-one-out error of a polynomial chaos expansion

Compute leave-one-out error of a polynomial chaos expansion

Metamodel of a field function

Metamodel of a field function

Polynomial chaos is sensitive to the degree

Polynomial chaos is sensitive to the degree

Create the Conditional expectation of a PCE

Create the Conditional expectation of a PCE

Polynomial chaos expansion cross-validation

Polynomial chaos expansion cross-validation

Validate a polynomial chaos

Validate a polynomial chaos

Quick start: the Ishigami function

Quick start: the Ishigami function

Compute grouped indices for the Ishigami function

Compute grouped indices for the Ishigami function

Compute Sobol’ indices confidence intervals

Compute Sobol' indices confidence intervals

Use advanced features for PCE

Use advanced features for PCE

Create a full or sparse polynomial chaos expansion

Create a full or sparse polynomial chaos expansion

Get the (output) marginal of a PCE

Get the (output) marginal of a PCE