GaussianProcessRegressionResult

class GaussianProcessRegressionResult(*args)

Gaussian process regression (aka kriging) result.

Warning

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

Parameters:
gpfResultGaussianProcessFitterResult

Structure result of a gaussian process fitter.

covarianceCoefficients2-d sequence of float

The \vect{\gamma} defined in (2).

Methods

getBasis()

Accessor to the collection of basis.

getClassName()

Accessor to the object's name.

getCovarianceCoefficients()

Accessor to the covariance coefficients.

getCovarianceModel()

Accessor to the covariance model.

getInputSample()

Accessor to the input sample.

getLinearAlgebraMethod()

Accessor to the used linear algebra method to fit.

getMetaModel()

Accessor to the metamodel.

getName()

Accessor to the object's name.

getNoise()

Accessor to the Gaussian process.

getOptimalLogLikelihood()

Accessor to the optimal log-likelihood of the model.

getOutputSample()

Accessor to the output sample.

getRegressionMatrix()

Accessor to the regression matrix.

getRelativeErrors()

Accessor to the relative errors.

getResiduals()

Accessor to the residuals.

getTrendCoefficients()

Accessor to the trend coefficients.

hasName()

Test if the object is named.

setInputSample(sampleX)

Accessor to the input sample.

setMetaModel(metaModel)

Accessor to the metamodel.

setName(name)

Accessor to the object's name.

setOutputSample(sampleY)

Accessor to the output sample.

setRelativeErrors(relativeErrors)

Accessor to the relative errors.

setResiduals(residuals)

Accessor to the residuals.

Notes

The Gaussian Process Regression (aka Kriging) meta model \tilde{\cM} is defined by:

(1)\tilde{\cM}(\vect{x}) =  \vect{\mu}(\vect{x}) + \Expect{\vect{Y}(\omega, \vect{x})\,| \,\cC}

where \cC is the condition \vect{Y}(\omega, \vect{x}_k) = \vect{y}_k for each k \in [1, \sampleSize].

Equation (1) writes:

\tilde{\cM}(\vect{x}) = \vect{\mu}(\vect{x}) + \Cov{\vect{Y}(\omega, \vect{x}), (\vect{Y}(\omega,\vect{x}_1),\dots,\vect{Y}(\omega, \vect{x}_{\sampleSize}))}\vect{\gamma}

where

\Cov{\vect{Y}(\omega, \vect{x}), (\vect{Y}(\omega, \vect{x}_1),\dots,\vect{Y}(\omega, \vect{x}_{\sampleSize}))} = \left(\mat{C}(\vect{x},\vect{x}_1)|\dots|\mat{C}(\vect{x},\vect{x}_{\sampleSize})\right)\in \cM_{\outputDim,\sampleSize \times \outputDim}(\Rset)

and

(2)\vect{\gamma} = \mat{C}^{-1}(\vect{y}-\vect{m})

At the end, the meta model writes:

(3)\tilde{\cM}(\vect{x}) = \vect{\mu}(\vect{x}) + \sum_{i=1}^{\sampleSize} \gamma_i  \mat{C}(\vect{x},\vect{x}_i)

Examples

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

>>> import openturns as ot
>>> import openturns.experimental as otexp
>>> g = ot.SymbolicFunction(['x'],  ['x * sin(x)'])
>>> sampleX = [[1.0], [2.0], [3.0], [4.0], [5.0], [6.0]]
>>> sampleY = g(sampleX)

Create the algorithm:

>>> basis = ot.Basis([ot.SymbolicFunction(['x'], ['x']), ot.SymbolicFunction(['x'], ['x^2'])])
>>> covarianceModel = ot.GeneralizedExponential([2.0], 2.0)
>>> fit_algo = otexp.GaussianProcessFitter(sampleX, sampleY, covarianceModel, basis)
>>> fit_algo.run()
>>> algo = otexp.GaussianProcessRegression(fit_algo.getResult())
>>> algo.run()

Get the result:

>>> result = algo.getResult()

Get the meta model:

>>> metaModel = result.getMetaModel()
__init__(*args)
getBasis()

Accessor to the collection of basis.

Returns:
basisBasis

Functional basis of size b : (\varphi^\ell: \Rset^{\inputDim} \rightarrow \Rset^{\outputDim}) for each l \in [1, b].

Notes

If the trend is not estimated, the basis is empty.

getClassName()

Accessor to the object’s name.

Returns:
class_namestr

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

getCovarianceCoefficients()

Accessor to the covariance coefficients.

Returns:
covCoeffSample

The \vect{\gamma} defined in (2).

getCovarianceModel()

Accessor to the covariance model.

Returns:
covModelCovarianceModel

The covariance model of the Gaussian process W.

getInputSample()

Accessor to the input sample.

Returns:
inputSampleSample

The input sample.

getLinearAlgebraMethod()

Accessor to the used linear algebra method to fit.

Returns:
linAlgMethodint

The used linear algebra method to fit the model:

  • otexp.GaussianProcessFitterResult.LAPACK or 0: using LAPACK to fit the model,

  • otexp.GaussianProcessFitterResult.HMAT or 1: using HMAT to fit the model.

getMetaModel()

Accessor to the metamodel.

Returns:
metaModelFunction

Metamodel.

getName()

Accessor to the object’s name.

Returns:
namestr

The name of the object.

getNoise()

Accessor to the Gaussian process.

Returns:
processProcess

Returns the Gaussian process W with the optimized parameters.

getOptimalLogLikelihood()

Accessor to the optimal log-likelihood of the model.

Returns:
optimalLogLikelihoodfloat

The value of the log-likelihood corresponding to the model.

getOutputSample()

Accessor to the output sample.

Returns:
outputSampleSample

The output sample.

getRegressionMatrix()

Accessor to the regression matrix.

Returns:
processMatrix

Returns the regression matrix.

getRelativeErrors()

Accessor to the relative errors.

Returns:
relativeErrorsPoint

The relative errors defined as follows for each output of the model: \displaystyle \frac{\sum_{i=1}^N (y_i - \hat{y_i})^2}{N \Var{\vect{Y}}} with \vect{Y} the vector of the N model’s values y_i and \hat{y_i} the metamodel’s values.

getResiduals()

Accessor to the residuals.

Returns:
residualsPoint

The residual values defined as follows for each output of the model: \displaystyle \frac{\sqrt{\sum_{i=1}^N (y_i - \hat{y_i})^2}}{N} with y_i the N model’s values and \hat{y_i} the metamodel’s values.

getTrendCoefficients()

Accessor to the trend coefficients.

Returns:
trendCoefsequence of float

The trend coefficients vectors (\vect{\alpha}^1, \dots, \vect{\alpha}^{\outputDim}) as a Point

hasName()

Test if the object is named.

Returns:
hasNamebool

True if the name is not empty.

setInputSample(sampleX)

Accessor to the input sample.

Parameters:
inputSampleSample

The input sample.

setMetaModel(metaModel)

Accessor to the metamodel.

Parameters:
metaModelFunction

Metamodel.

setName(name)

Accessor to the object’s name.

Parameters:
namestr

The name of the object.

setOutputSample(sampleY)

Accessor to the output sample.

Parameters:
outputSampleSample

The output sample.

setRelativeErrors(relativeErrors)

Accessor to the relative errors.

Parameters:
relativeErrorssequence of float

The relative errors defined as follows for each output of the model: \displaystyle \frac{\sum_{i=1}^N (y_i - \hat{y_i})^2}{N \Var{\vect{Y}}} with \vect{Y} the vector of the N model’s values y_i and \hat{y_i} the metamodel’s values.

setResiduals(residuals)

Accessor to the residuals.

Parameters:
residualssequence of float

The residual values defined as follows for each output of the model: \displaystyle \frac{\sqrt{\sum_{i=1}^N (y_i - \hat{y_i})^2}}{N} with y_i the N model’s values and \hat{y_i} the metamodel’s values.

Examples using the class

Gaussian Process Regression : cantilever beam model

Gaussian Process Regression : cantilever beam model

Gaussian Process Regression : quick-start

Gaussian Process Regression : quick-start

Sequentially adding new points to a Kriging

Sequentially adding new points to a Kriging