KarhunenLoeveQuadratureFactory

(Source code, png, hires.png, pdf)

../../_images/KarhunenLoeveQuadratureFactory.png
class KarhunenLoeveQuadratureFactory(*args)

Computation of Karhunen-Loeve decomposition using Quadrature approximation.

Parameters:

domain : Domain

The domain on which the Fredholm equation is defined.

experiment : WeightedExperiment

The algorithm used to discretize the integrale defining the Fredholm equation.

basis : Basis

The basis from which the base functions are taken to define the finite space on which live the approximate eigenfunctions.

basisSize : int

The dimension of the finite approximation space.

mustScale : bool

Flag to tell if a scaling function has to be inserted in the base functions.

threshold : float

The minimal relative amplitude of the eigenvalues to consider in the decomposition wrt the maximum eigenvalue.

Notes

The Karhunen-Loeve decomposition using Quadrature approximation allows to approximate the solution of the second kind Fredholm equation:

\int_{\cD} \mat{C}(\vect{s},\vect{t})\vect{\phi}_n(\vect{s})\di{\vect{s}}=\lambda_n\vect{\phi}_n(\vect{t})

with \mat{C}: \cD\times\cD \mapsto \cS^+_d(\Rset) a given covariance function, \lambda_n a nonincreasing sequence of nonnegative values (the eigenvalues of the equation) and \vect{\phi}_n: \cD\mapsto\Rset^d the associated sequence of eigenfunctions, normalized by \int_{\cD_N}\|\vect{\phi}_n(\vect{s})\|^2\di{\vect{s}}=1.

The Karhunen-Loeve quadrature approximation consists in replacing the integrals defining the Fredholm equation by its quadrature approximation counterpart:

\int_{\Rset^d} \mat{C}(\vect{s},\vect{t})\vect{\phi}_n(\vect{s})\di{\vect{s}}\simeq\sum_{\ell=1}^L\omega_{\ell}\mat{C}(\vect{\xi}_{\ell},\vect{t})\vect{\phi}_n(\vect{\xi}_{\ell})\dfrac{\fcar{\vect{\xi}_{\ell}}{\cD}}{p(\vect{\xi}_{\ell})}

Where (\omega_{\ell},\vect{\xi}_{\ell})_{\ell=1,\dots,L} is a quadrature formula wrt the density function p such that its support contains \cD, ie the discrete measure \sum_{\ell=1}^L\omega_{\ell}\delta_{\vect{\xi}_{\ell}} is an approximation of the probability measure defined by p.

The eigenfunctions \phi_n are decomposed into a functional basis (\theta_p)_{p=1,\dots,P}:

\forall \vect{s}\in\cD,\quad \phi_n(\vect{s})=\sum_{p=1}^P\vect{\alpha}_n^p\theta_p(\vect{s})

and the associated coefficients are found using a Galerkin projection on the space generated by (\theta_p)_{p=1,\dots,P}.

Examples

Create a Karhunen-Loeve Quadrature factory:

>>> import openturns as ot
>>> domain = ot.Interval([-1.0]*2, [1.0]*2)
>>> basis = ot.OrthogonalProductPolynomialFactory([ot.LegendreFactory()]*2)
>>> basisSize = 10
>>> samplingSize = 20
>>> experiment = ot.LHSExperiment(basis.getMeasure(), samplingSize)
>>> mustScale = False
>>> threshold = 0.01
>>> factory = ot.KarhunenLoeveQuadratureFactory(domain, experiment, basis, basisSize, mustScale, threshold)

Methods

build(covarianceModel, eigenvalues) Computation of the eigenvalues and eigen functions.
getClassName() Accessor to the object’s name.
getId() Accessor to the object’s id.
getName() Accessor to the object’s name.
getShadowedId() Accessor to the object’s shadowed id.
getVisibility() Accessor to the object’s visibility state.
hasName() Test if the object is named.
hasVisibleName() Test if the object has a distinguishable name.
setName(name) Accessor to the object’s name.
setShadowedId(id) Accessor to the object’s shadowed id.
setVisibility(visible) Accessor to the object’s visibility state.
__init__(*args)
build(covarianceModel, eigenvalues)

Computation of the eigenvalues and eigen functions.

Parameters:

C : CovarianceModel, \mat{C}: \cD\times\cD \mapsto \cS^+_d(\Rset)

The covariance model.

ev : NumericalPoint

The eigenvalues \lambda_n in descending order such that \lambda_n/\lambda_0\geq\mathrm{threshold}

Returns:

functions : Basis

Eigen functions of the covariance model as a basis of functions using QuadratureLagrangeEvaluationImplementation.

Examples

>>> import openturns as ot
>>> domain = ot.Interval([-1.0]*2, [1.0]*2)
>>> basis = ot.OrthogonalProductPolynomialFactory([ot.LegendreFactory()]*2)
>>> basisSize = 10
>>> samplingSize = 20
>>> experiment = ot.LHSExperiment(basis.getMeasure(), samplingSize)
>>> mustScale = False
>>> threshold = 0.01
>>> factory = ot.KarhunenLoeveQuadratureFactory(domain, experiment, basis, basisSize, mustScale, threshold)
>>> model = ot.AbsoluteExponential([1.0]*2)
>>> ev = ot.NumericalPoint()
>>> functions = factory.build(model, ev)
getClassName()

Accessor to the object’s name.

Returns:

class_name : str

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

getId()

Accessor to the object’s id.

Returns:

id : int

Internal unique identifier.

getName()

Accessor to the object’s name.

Returns:

name : str

The name of the object.

getShadowedId()

Accessor to the object’s shadowed id.

Returns:

id : int

Internal unique identifier.

getVisibility()

Accessor to the object’s visibility state.

Returns:

visible : bool

Visibility flag.

hasName()

Test if the object is named.

Returns:

hasName : bool

True if the name is not empty.

hasVisibleName()

Test if the object has a distinguishable name.

Returns:

hasVisibleName : bool

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

setName(name)

Accessor to the object’s name.

Parameters:

name : str

The name of the object.

setShadowedId(id)

Accessor to the object’s shadowed id.

Parameters:

id : int

Internal unique identifier.

setVisibility(visible)

Accessor to the object’s visibility state.

Parameters:

visible : bool

Visibility flag.