StationaryCovarianceModelFactory¶
(Source code
, png
)
- class StationaryCovarianceModelFactory(*args)¶
Estimation of the covariance model of a stationary process.
Refer to Estimation of a stationary covariance model.
- Parameters:
- spectralModelFactory
SpectralModelFactory
The spectral model factory.
By default, it is the Welch factory model.
- spectralModelFactory
Methods
build
(*args)Estimate a stationary covariance model.
Estimate the covariance model as a User defined covariance model.
Accessor to the object's name.
getName
()Accessor to the object's name.
Accessor to the underlying Welch agorithm.
hasName
()Test if the object is named.
setName
(name)Accessor to the object's name.
setSpectralModelFactory
(factory)Accessor to the underlying Welch agorithm.
Notes
We consider be a multivariate process of dimension d where . We only treat here the case where the domain is of dimension 1: (). We denote the vertices of the mesh which is a time grid supposed regular.
X is supposed to be a stationary second order process with zero mean. We note its covariance function , defined by for all .
In addition, we suppose that its spectral density function is defined, where is the set of d-dimensional positive definite hermitian matrices.
OpenTURNS estimates from a field or a sample of fields of X, using first the estimation of the spectral density function and then mapping S into using the inversion relation :
when it is possible.
As the mesh is a time grid (), the fields can be interpreted as time series.
The estimation algorithm is outlined hereafter.
Let be M independent realizations of X or M segments of one realization of the process.
Using the relation between the covariance model end the spectral function, the covariance function writes:
(1)¶
where is the element (i,j) of the matrix and the one of . The integral (1) is approximated by its evaluation on the finite domain :
(2)¶
Let us consider the partition of the domain as follows:
is subdivised into M segments with
be the frequency step,
be the frequences on which the spectral density is computed, with
The equation (2) can be rewritten as:
We focus on the integral on each subdomain . Using numerical approximation, we have:
must be in correspondence with frequency values with respect to the Shannon criteria. Thus the temporal domain of estimation is the following:
is the time step, such as
is subdivised into M segments with
be the time values on which the covariance is estimated,
The estimate of the covariance value at time value depends on the quantities of form:
(3)¶
We develop the expression of and and we get:
Thus:
and:
We denote:
Finally, we get the followig expression for integral in (3):
It follows that:
(4)¶
In the equation (4), we notice a discrete inverse Fourier transform.
- __init__(*args)¶
- build(*args)¶
Estimate a stationary covariance model.
- Available usages:
build(processSample)
build(field)
- Parameters:
- processSample
ProcessSample
The collection of fields used to estimate the covariance model.
- field
Field
The field used to estimate the covariance model.
- processSample
- Returns:
- covEst
CovarianceModel
The estimated covariance model.
- covEst
Notes
The fields must be time series, ie the underlying mesh must be a 1D lattice.
The estimated
CovarianceModel
which is aUserDefinedStationaryCovarianceModel
composed of a time grid and a collection of K square matrices of dimension d where K corresponds to the number of time steps of the final time grid on which the covariance is estimated.When estimated from a time series, the
UserDefinedStationaryCovarianceModel
may have a time grid different from the initial time grid of the time series.Examples
Create the stationary covariance model, a mesh and a process:
>>> import openturns as ot >>> myModel = ot.AbsoluteExponential([0.1]) >>> myTimeGrid = ot.RegularGrid(0.0, 0.1, 10) >>> myProcess = ot.GaussianProcess(myModel, myTimeGrid)
Generate 20 fields:
>>> mySample = myProcess.getSample(20)
Estimate the covariance model supposing the stationarity:
>>> myEstCov = ot.StationaryCovarianceModelFactory().build(mySample)
- buildAsUserDefinedStationaryCovarianceModel(*args)¶
Estimate the covariance model as a User defined covariance model.
- Available usages:
buildAsUserDefinedStationaryCovarianceModel(processSample)
buildAsUserDefinedStationaryCovarianceModel(field)
buildAsUserDefinedStationaryCovarianceModel(spectralModel)
buildAsUserDefinedStationaryCovarianceModel(spectralModel, frequencyGrid)
- Parameters:
- processSample
ProcessSample
The collection fields used to estimate the covariance model which is supposed to be stationary.
- field
Field
The field used to estimate the covariance model.
- spectralModel
UserDefinedSpectralModel
if alone, otherwiseSpectralModel
The spectral model to convert into a covariance model.
- frequencyGrid
RegularGrid
The frequency grid over which the spectral model is discretized.
- processSample
- Returns:
- covEst
UserDefinedStationaryCovarianceModel
The estimated covariance model that can be used as a
UserDefinedStationaryCovarianceModel
.
- covEst
- getClassName()¶
Accessor to the object’s name.
- Returns:
- class_namestr
The object class name (object.__class__.__name__).
- getName()¶
Accessor to the object’s name.
- Returns:
- namestr
The name of the object.
- getSpectralModelFactory()¶
Accessor to the underlying Welch agorithm.
- Returns:
- spectralModelFactory
WelchFactory
The Welch algorithm used to estimate the stationary covariance model.
- spectralModelFactory
- hasName()¶
Test if the object is named.
- Returns:
- hasNamebool
True if the name is not empty.
- setName(name)¶
Accessor to the object’s name.
- Parameters:
- namestr
The name of the object.
- setSpectralModelFactory(factory)¶
Accessor to the underlying Welch agorithm.
- Parameters:
- spectralModelFactory
WelchFactory
The Welch algorithm to use to estimate the stationary covariance model.
- spectralModelFactory
Examples using the class¶
Estimate a stationary covariance function