NonStationaryCovarianceModelFactory¶
(Source code, png, hires.png, pdf)
-
class
NonStationaryCovarianceModelFactory
(*args)¶ Estimation of a non stationary covariance model.
Refer to Estimation of a non stationary cov. model.
Notes
We consider be a multivariate process of dimension d where . We denote the vertices of the mesh .
X is supposed to be a second order process and we note its covariance function. X may be stationary or non stationary as well.
We suppose that we have K fields and we note the values of the field k on the mesh .
We recall that the covariance function C writes:
where the mean function is defined by:
First, we estimate the covariance function C on the vertices of the mesh using the empirical mean estimator:
Then, we build a covariance function defined on which is a piecewise constant function defined on by:
where k is such that is the vertex of the nearest to and the nearest to .
Methods
build
(self, \*args)Estimate the covariance model.
buildAsCovarianceMatrix
(self, sample[, …])Estimate the covariance model as a covariance matrix.
buildAsUserDefinedCovarianceModel
(self, sample)Estimate the covariance model as a User defined covariance model.
getClassName
(self)Accessor to the object’s name.
getId
(self)Accessor to the object’s id.
getName
(self)Accessor to the object’s name.
getShadowedId
(self)Accessor to the object’s shadowed id.
getVisibility
(self)Accessor to the object’s visibility state.
hasName
(self)Test if the object is named.
hasVisibleName
(self)Test if the object has a distinguishable name.
setName
(self, name)Accessor to the object’s name.
setShadowedId
(self, id)Accessor to the object’s shadowed id.
setVisibility
(self, visible)Accessor to the object’s visibility state.
-
__init__
(self, \*args)¶ Initialize self. See help(type(self)) for accurate signature.
-
build
(self, \*args)¶ Estimate the covariance model.
- Parameters
- sampleFields
ProcessSample
The fields used to estimate the covariance model which is not supposed to be stationary.
- sampleFields
- Returns
- covEst
CovarianceModelImplementation
The estimated covariance model.
- covEst
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
(self, sample, isCentered=False)¶ Estimate the covariance model as a covariance matrix.
- Parameters
- sampleFields
ProcessSample
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.
- sampleFields
- Returns
- covEst
CovarianceMatrix
The unbiased estimation of the discretization of the covariance function over the mesh defining the given sample.
- covEst
-
buildAsUserDefinedCovarianceModel
(self, sample, isCentered=False)¶ Estimate the covariance model as a User defined covariance model.
- Parameters
- sampleFields
ProcessSample
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.
- sampleFields
- Returns
- covEst
UserDefinedCovarianceModel
The estimated covariance model that can be used as a
UserDefinedCovarianceModel
.
- covEst
-
getClassName
(self)¶ Accessor to the object’s name.
- Returns
- class_namestr
The object class name (object.__class__.__name__).
-
getId
(self)¶ Accessor to the object’s id.
- Returns
- idint
Internal unique identifier.
-
getName
(self)¶ Accessor to the object’s name.
- Returns
- namestr
The name of the object.
-
getShadowedId
(self)¶ Accessor to the object’s shadowed id.
- Returns
- idint
Internal unique identifier.
-
getVisibility
(self)¶ Accessor to the object’s visibility state.
- Returns
- visiblebool
Visibility flag.
-
hasName
(self)¶ Test if the object is named.
- Returns
- hasNamebool
True if the name is not empty.
-
hasVisibleName
(self)¶ Test if the object has a distinguishable name.
- Returns
- hasVisibleNamebool
True if the name is not empty and not the default one.
-
setName
(self, name)¶ Accessor to the object’s name.
- Parameters
- namestr
The name of the object.
-
setShadowedId
(self, id)¶ Accessor to the object’s shadowed id.
- Parameters
- idint
Internal unique identifier.
-
setVisibility
(self, visible)¶ Accessor to the object’s visibility state.
- Parameters
- visiblebool
Visibility flag.
-