LeastSquaresMethod

class LeastSquaresMethod(*args)

Base class for least square solvers.

Available constructors:

LeastSquaresMethod(proxy, y, weight, indices)

LeastSquaresMethod(proxy, y, indices)

Parameters:

proxy : DesignProxy

Input sample

y : NumericalSample

Output sample

weight : sequence of float

Output weights

indices : sequence of int

Indices allowed in the basis

Notes

Solve the least-squares problem:

\vect{a} = \argmin_{\vect{b} \in \Rset^P} ||y - \vect{b}^{\intercal} \vect{\Psi}(\vect{U})||^2

Methods

buildCurrentBasis() Build the current basis.
computeWeightedDesign([whole]) Build the design matrix.
getBasis() Basis accessor.
getClassName() Accessor to the object’s name.
getCurrentIndices() Current indices accessor.
getGramInverseTrace()
getHDiag()
getId() Accessor to the object’s id.
getImplementation(*args) Accessor to the underlying implementation.
getInitialIndices() Initial indices accessor.
getInputSample() Input sample accessor.
getName() Accessor to the object’s name.
getOutputSample() Output sample accessor.
getWeight() Weights accessor.
setName(name) Accessor to the object’s name.
solve(rhs)
solveNormal(rhs)
update(addedIndices, conservedIndices, ...) Update the current decomposition.
__init__(*args)
buildCurrentBasis()

Build the current basis.

Returns:

phi : Basis

The basis according to current indices

computeWeightedDesign(whole=False)

Build the design matrix.

Parameters:

whole : bool, defaults to False

Whether to use the initial indices instead of the current indices

Returns:

psiAk : Matrix

The design matrix

getBasis()

Basis accessor.

Returns:

basis : getBasis

Basis.

getClassName()

Accessor to the object’s name.

Returns:

class_name : str

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

getCurrentIndices()

Current indices accessor.

Returns:

indices : Indices

Indices of the current decomposition in the global basis.

getId()

Accessor to the object’s id.

Returns:

id : int

Internal unique identifier.

getImplementation(*args)

Accessor to the underlying implementation.

Returns:

impl : Implementation

The implementation class.

getInitialIndices()

Initial indices accessor.

Returns:

indices : Indices

Initial indices of the terms in the global basis.

getInputSample()

Input sample accessor.

Returns:

inputSample : NumericalSample

Input sample.

getName()

Accessor to the object’s name.

Returns:

name : str

The name of the object.

getOutputSample()

Output sample accessor.

Returns:

inputSample : NumericalSample

Output sample.

getWeight()

Weights accessor.

Returns:

weight : NumericalPoint

Weights.

setName(name)

Accessor to the object’s name.

Parameters:

name : str

The name of the object.

update(addedIndices, conservedIndices, removedIndices, row=False)

Update the current decomposition.

Parameters:

addedIndices : sequence of int

Indices of added basis terms.

conservedIndices : sequence of int

Indices of conserved basis terms.

removedIndices : sequence of int

Indices of removed basis terms.