GaussianProcessConditionalCovariance

class GaussianProcessConditionalCovariance(*args)

Conditional covariance post processing of a Gaussian Process Regression result.

Warning

This class is experimental and likely to be modified in future releases. To use it, import the openturns.experimental submodule.

Parameters:
gprResultGaussianProcessRegressionResult

The result class of a Gaussian process regression.

Methods

getClassName()

Accessor to the object's name.

getConditionalCovariance(*args)

Compute the conditional covariance of the Gaussian process on a point (or several points).

getConditionalMarginalCovariance(*args)

Compute the conditional covariance of the Gaussian process on a point (or several points).

getConditionalMarginalVariance(*args)

Compute the conditional variance of the Gaussian process on a point (or several points).

getConditionalMean(*args)

Compute the conditional mean of the Gaussian process on a point or a sample of points.

getName()

Accessor to the object's name.

hasName()

Test if the object is named.

setName(name)

Accessor to the object's name.

Notes

The class provides services around conditional covariance of a Gaussian Process Regression

Examples

Create the model \cM: \Rset \mapsto \Rset and the samples:

>>> import openturns as ot
>>> from openturns.experimental import GaussianProcessRegression
>>> from openturns.experimental import GaussianProcessConditionalCovariance
>>> trend = ot.SymbolicFunction(['x'],  ['1'])
>>> sampleX = [[1.0], [2.0], [3.0], [4.0], [5.0], [6.0]]
>>> sampleY = trend(sampleX)

Create the algorithm:

>>> covarianceModel = ot.SquaredExponential([1.0])
>>> covarianceModel.setActiveParameter([])
>>> algo = GaussianProcessRegression(sampleX, sampleY, covarianceModel, trend)
>>> algo.run()
>>> result = algo.getResult()
>>> condCov = GaussianProcessConditionalCovariance(result)
>>> c = condCov([1.1])
__init__(*args)
getClassName()

Accessor to the object’s name.

Returns:
class_namestr

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

getConditionalCovariance(*args)

Compute the conditional covariance of the Gaussian process on a point (or several points).

Parameters:
xsequence of float

The point \vect{x} where the conditional covariance of the output has to be evaluated.

sampleX2-d sequence of float

The sample (\vect{\xi}_1, \dots, \vect{\xi}_M) where the conditional covariance of the output has to be evaluated (M can be equal to 1).

Returns:
condCovCovarianceMatrix

The conditional covariance \Cov{\vect{Y}(\omega, \vect{x})\, | \,  \cC} at point \vect{x}. Or the conditional covariance matrix at the sample (\vect{\xi}_1, \dots, \vect{\xi}_M):

\left(
  \begin{array}{lcl}
    \Sigma_{11} & \dots & \Sigma_{1M} \\
    \dots  \\
    \Sigma_{M1} & \dots & \Sigma_{MM}
  \end{array}
\right)

where \Sigma_{ij} = \Cov{\vect{Y}(\omega, \vect{\xi}_i), \vect{Y}(\omega, \vect{\xi}_j)\, | \,  \cC}.

getConditionalMarginalCovariance(*args)

Compute the conditional covariance of the Gaussian process on a point (or several points).

Parameters:
xsequence of float

The point \vect{x} where the conditional marginal covariance of the output has to be evaluated.

sampleX2-d sequence of float

The sample (\vect{\xi}_1, \dots, \vect{\xi}_M) where the conditional marginal covariance of the output has to be evaluated (M can be equal to 1).

Returns:
condCovCovarianceMatrix

The conditional covariance \Cov{\vect{Y}(\omega, \vect{x})\, | \,  \cC} at point \vect{x}.

condCovCovarianceMatrixCollection

The collection of conditional covariance matrices \Cov{\vect{Y}(\omega, \vect{\xi})\, | \,  \cC} at each point of the sample (\vect{\xi}_1, \dots, \vect{\xi}_M):

Notes

In case input parameter is a of type Sample, each element of the collection corresponds to the conditional covariance with respect to the input learning set (pointwise evaluation of the getConditionalCovariance).

getConditionalMarginalVariance(*args)

Compute the conditional variance of the Gaussian process on a point (or several points).

Parameters:
xsequence of float

The point \vect{x} where the conditional variance of the output has to be evaluated.

sampleX2-d sequence of float

The sample (\vect{\xi}_1, \dots, \vect{\xi}_M) where the conditional variance of the output has to be evaluated (M can be equal to 1).

marginalIndexint

Marginal of interest (for multiple outputs). Default value is 0

marginalIndicessequence of int

Marginals of interest (for multiple outputs).

Returns:
varfloat

Variance of interest. float if one point (x) and one marginal of interest (x, marginalIndex)

varPointsequence of float

The marginal variances

Notes

In case of fourth usage, the sequence of float is given as the concatenation of marginal variances for each point in sampleX.

getConditionalMean(*args)

Compute the conditional mean of the Gaussian process on a point or a sample of points.

Parameters:
xsequence of float

The point \vect{x} where the conditional mean of the output has to be evaluated.

sampleX2-d sequence of float

The sample (\vect{\xi}_1, \dots, \vect{\xi}_M) where the conditional mean of the output has to be evaluated (M can be equal to 1).

Returns:
condMeanPoint

The conditional mean \Expect{\vect{Y}(\omega, \vect{x})\, | \,  \cC} at point \vect{x}. Or the conditional mean matrix at the sample (\vect{\xi}_1, \dots, \vect{\xi}_M):

\left(
  \begin{array}{l}
    \Expect{\vect{Y}(\omega, \vect{\xi}_1)\, | \,  \cC}\\
    \dots  \\
    \Expect{\vect{Y}(\omega, \vect{\xi}_M)\, | \,  \cC}
  \end{array}
\right)

getName()

Accessor to the object’s name.

Returns:
namestr

The name of the object.

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.

Examples using the class

Gaussian Process Regression : quick-start

Gaussian Process Regression : quick-start

Sequentially adding new points to a Kriging

Sequentially adding new points to a Kriging