NonStationaryCovarianceModelFactory

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

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

Estimation of a non stationary covariance model.

Refer to Estimation of a non stationary cov. model.

Notes

We consider X: \Omega \times \cD \rightarrow \Rset^d be a multivariate process of dimension d where \cD \in \Rset^n. We denote (\vect{t}_0, \dots, \vect{t}_{N-1}) the vertices of the mesh \cM \in \cD.

X is supposed to be a second order process and we note C : \cD \times \cD \rightarrow \mathcal{M}_{d \times d}(\mathbb{R}) its covariance function. X may be stationary or non stationary as well.

We suppose that we have K fields and we note (\vect{x}_0^k, \dots, \vect{x}_{N-1}^k) the values of the field k on the mesh \cM.

We recall that the covariance function C writes:

\forall (\vect{s}, \vect{t}) \in \cD \times \cD, \quad C(\vect{s}, \vect{t}) = \Expect{\left(X_{\vect{s}}-m(\vect{s})\right)\Tr{\left(X_{\vect{t}}-m(\vect{t})\right)}}

where the mean function m: \cD \rightarrow \Rset^d is defined by:

\forall \vect{t}\in \cD , \quad m(\vect{t}) = \Expect{X_{\vect{t}}}

First, we estimate the covariance function C on the vertices of the mesh \cM using the empirical mean estimator:

\begin{eqnarray*}
    & \forall \vect{t}_i \in \cM, \quad m(\vect{t}_i) \simeq \frac{1}{K} \sum_{k=1}^{K} \vect{x}_i^k \\
    & \forall (\vect{t}_i, \vect{t}_j) \in \cD \times \cD, \quad C(\vect{t}_i, \vect{t}_j) \simeq \frac{1}{K} \sum_{k=1}^{K} \left( \vect{x}_i^k - m(\vect{t}_i) \right) \Tr{\left( \vect{x}_j^k - m(\vect{t}_j) \right)}
\end{eqnarray*}

Then, we build a covariance function defined on \cD \times \cD which is a piecewise constant function defined on \cD \times \cD by:

\forall (\vect{s}, \vect{t}) \in \cD \times \cD, \, C(\vect{s}, \vect{t}) = C(\vect{t}_k, \vect{t}_l)

where k is such that \vect{t}_k is the vertex of \cM the nearest to \vect{s} and \vect{t}_l the nearest to \vect{t}.

Methods

build(*args)

Estimate the covariance model.

buildAsCovarianceMatrix(sample[, isCentered])

Estimate the covariance model as a covariance matrix.

buildAsUserDefinedCovarianceModel(sample[, ...])

Estimate the covariance model as a User defined covariance model.

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(*args)

Estimate the covariance model.

Parameters:
sampleFieldsProcessSample

The fields used to estimate the covariance model which is not supposed to be stationary.

Returns:
covEstCovarianceModelImplementation

The estimated covariance model.

Examples

Create the covariance model, a mesh and a process:

>>> import openturns as ot
>>> myModel = ot.AbsoluteExponential([0.1]*2)
>>> myMesh = ot.IntervalMesher([10]*2).build(ot.Interval([0.0]*2, [1.0]*2))
>>> myProcess = ot.GaussianProcess(myModel, myMesh)

Generate 10 fields:

>>> mySample = myProcess.getSample(10)

Estimate the covariance model without supposing the stationarity:

>>> myEstCov = ot.NonStationaryCovarianceModelFactory().build(mySample)
buildAsCovarianceMatrix(sample, isCentered=False)

Estimate the covariance model as a covariance matrix.

Parameters:
sampleFieldsProcessSample

The fields used to estimate the covariance model.

isCenteredbool, optional

Flag telling if the given sample is from a centered process or if it has to be centered by the empirical mean. Default value is False.

Returns:
covEstCovarianceMatrix

The unbiased estimation of the discretization of the covariance function over the mesh defining the given sample.

buildAsUserDefinedCovarianceModel(sample, isCentered=False)

Estimate the covariance model as a User defined covariance model.

Parameters:
sampleFieldsProcessSample

The fields used to estimate the covariance model.

isCenteredbool, optional

Flag telling if the given sample is from a centered process or if it has to be centered by the empirical mean. Default value is False.

Returns:
covEstUserDefinedCovarianceModel

The estimated covariance model that can be used as a UserDefinedCovarianceModel.

getClassName()

Accessor to the object’s name.

Returns:
class_namestr

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

getId()

Accessor to the object’s id.

Returns:
idint

Internal unique identifier.

getName()

Accessor to the object’s name.

Returns:
namestr

The name of the object.

getShadowedId()

Accessor to the object’s shadowed id.

Returns:
idint

Internal unique identifier.

getVisibility()

Accessor to the object’s visibility state.

Returns:
visiblebool

Visibility flag.

hasName()

Test if the object is named.

Returns:
hasNamebool

True if the name is not empty.

hasVisibleName()

Test if the object has a distinguishable name.

Returns:
hasVisibleNamebool

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

setName(name)

Accessor to the object’s name.

Parameters:
namestr

The name of the object.

setShadowedId(id)

Accessor to the object’s shadowed id.

Parameters:
idint

Internal unique identifier.

setVisibility(visible)

Accessor to the object’s visibility state.

Parameters:
visiblebool

Visibility flag.

Examples using the class

Estimate a non stationary covariance function

Estimate a non stationary covariance function