PenalizedLeastSquaresAlgorithm

class PenalizedLeastSquaresAlgorithm(*args)

Penalized least squares algorithm.

Refer to Least squares problems numerical methods.

Available constructors:

PenalizedLeastSquaresAlgorithm(x, y, psi, indices, penalizationFactor=0, useNormal=False)

PenalizedLeastSquaresAlgorithm(x, y, weight, psi, indices, penalizationFactor=0, useNormal=False)

PenalizedLeastSquaresAlgorithm(x, y, weight, psi, indices, penalizationFactor=0, penalizationMatrix, useNormal=False)

Parameters:
x2-d sequence of float

The input random observations \left\{\vect{x}^{(1)}, ..., \vect{x}^{(n)}\right\} where \vect{x} = \Tr{\left(x_1, \dots, x_{n_X}\right)} is the input of the physical model, n_X \in \Nset is the input dimension and n \in \Nset is the sample size.

y2-d sequence of float

The output random observations \left\{\vect{y}^{(1)}, ..., \vect{y}^{(n)}\right\} where \vect{y} = \Tr{\left(y_1, \dots, y_{n_Y}\right)} is the output of the physical model, n_Y \in \Nset is the output dimension and n \in \Nset is the sample size.

weightsequence of float

Output weights

psisequence of Function

Basis

indicessequence of int

Indices allowed in the basis

penalizationFactorfloat, optional

Penalization factor

penalizationMatrix2-d sequence of float

Penalization matrix

useNormalbool, optional

Solve the normal equation

Notes

For each output marginal k \in \{1, ..., n_Y\}, solve the least-squares problem:

\widehat{\vect{a}} = \argmin_{\vect{a} \in \Rset^P} \left\|\vect{y}_k - \Tr{\mat{\Psi}} \vect{a} \right\|^2

where \vect{y}_k \in \Rset^{n} is the k-th marginal of the sample of output observations, P \in \Nset is the number of coefficients, \mat{\Psi} \in \Rset^{n \times P} is the design matrix computed from the input sample x and \vect{a} \in \Rset^P is the vector of coefficients.

Methods

getClassName()

Accessor to the object's name.

getCoefficients()

Accessor to the coefficients.

getName()

Accessor to the object's name.

getPsi()

Accessor to the basis.

getRelativeError()

Accessor to the coefficients.

getResidual()

Accessor to the coefficients.

getWeight()

Accessor to the weights.

getX()

Accessor to the input sample.

getY()

Accessor to the output sample.

hasName()

Test if the object is named.

involvesModelSelection()

Get the model selection flag.

run()

Run the algorithm.

setName(name)

Accessor to the object's name.

__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:
coefficientsPoint

The coefficients

getName()

Accessor to the object’s name.

Returns:
namestr

The name of the object.

getPsi()

Accessor to the basis.

Returns:
coefficientsBasis

The basis

getRelativeError()

Accessor to the coefficients.

Returns:
relativeErrorfloat

The relative error

getResidual()

Accessor to the coefficients.

Returns:
coefficientsfloat

The residual

getWeight()

Accessor to the weights.

Returns:
weightPoint

Output weights

getX()

Accessor to the input sample.

Returns:
xSample

Input sample

getY()

Accessor to the output sample.

Returns:
ySample

Input sample

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:
involvesModelSelection: bool

True if the method involves a model selection method.

run()

Run the algorithm.

setName(name)

Accessor to the object’s name.

Parameters:
namestr

The name of the object.