GaussianProcessFitterResult

class GaussianProcessFitterResult(*args)

Gaussian process fitter result.

Refer to Gaussian process regression.

Parameters:
inputSample, outputSampleSample

The samples (\vect{x}_k)_{1 \leq k \leq \sampleSize} \in \Rset^{\inputDim} and (\vect{y}_k)_{1 \leq k \leq \sampleSize}\in \Rset^{\outputDim}.

metaModelFunction

The metamodel: \metaModel, defined in (1) by the trend function.

regressionMatrixMatrix

The regression matrix, e.g the evaluation of the basis functions upon the input design sample.

basisBasis

Functional basis of size b : (\varphi_j: \Rset^{\inputDim} \rightarrow \Rset) for j \in [1, b]. Its size should be equal to zero if the trend is not estimated.

trendCoefsequence of float

The trend coefficients vectors (\vect{\beta}^1, \dots, \vect{\beta}^{\outputDim}).

covarianceModelCovarianceModel

The covariance model of the Gaussian process with its optimized parameters.

optimalLogLikelihoodfloat

The maximum log-likelihood corresponding to the model.

linAlgMethodint

The used linear algebra method to fit the model:

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

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

Methods

getBasis()

Accessor to the basis.

getCenteredProcess()

Accessor to the Gaussian process.

getCholeskyFactor()

Accessor to the Cholesky factor of the covariance matrix.

getClassName()

Accessor to the object's name.

getCovarianceModel()

Accessor to the covariance model.

getHMatCholeskyFactor()

Accessor to the Cholesky factor of the covariance matrix.

getInputSample()

Accessor to the input sample.

getLinearAlgebraMethod()

Accessor to the linear algebra method used to fit.

getMetaModel()

Accessor to the metamodel.

getName()

Accessor to the object's name.

getNoise()

Output sample noise variance accessor.

getOptimalLogLikelihood()

Accessor to the optimal log-likelihood of the model.

getOutputSample()

Accessor to the output sample.

getRegressionMatrix()

Accessor to the regression matrix.

getStandardizedOutput()

Accessor to the standardized output.

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.

setNoise(noise)

Output sample noise variance accessor.

setOutputSample(sampleY)

Accessor to the output sample.

setStandardizedOutput(rho)

Accessor to the standardized output.

setCholeskyFactor

Notes

The structure is usually created by the method run() of the class GaussianProcessFitter and obtained with its method getResult().

Refer to Gaussian process regression (Step 1) to get all the notations and the theoretical aspects. We only detail here the notions related to the class.

This class creates the metamodel \metaModel: \Rset^{\inputDim} \rightarrow \Rset^{\outputDim} defined by the estimated trend function:

(1)\metaModel(\vect{x}) = \vect{\mu}(\vect{x}) = \left(
  \begin{array}{l}
    \mu_1(\vect{x}) \\
    \vdots  \\
    \mu_\outputDim(\vect{x})
   \end{array}
 \right)

with \mu_\ell(\vect{x}) = \sum_{j=1}^{b} \beta_j^\ell \varphi_j(\vect{x}) and \varphi_j: \Rset^\inputDim \rightarrow \Rset the trend functions for 1 \leq j \leq b and 1 \leq \ell \leq \outputDim.

Examples

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

>>> import openturns as ot
>>> 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)
>>> algo = ot.GaussianProcessFitter(sampleX, sampleY, covarianceModel, basis)
>>> algo.run()

Get the result:

>>> result = algo.getResult()

Get the metamodel \metaModel(\vect{x}) = \vect{\mu}(\vect{x}):

>>> metaModel = result.getMetaModel()
>>> graph = metaModel.draw(0.0, 7.0)
>>> cloud = ot.Cloud(sampleX, sampleY)
>>> cloud.setPointStyle('fcircle')
>>> graph = ot.Graph()
>>> graph.add(cloud)
>>> graph.add(g.draw(0.0, 7.0))
__init__(*args)
getBasis()

Accessor to the basis.

Returns:
basisBasis

Functional basis to estimate the trend: (\varphi_j)_{1 \leq j \leq b}: \Rset^\inputDim \rightarrow \Rset.

Notes

If the trend is not estimated, the basis is empty. The same basis is used for each marginal output.

getCenteredProcess()

Accessor to the Gaussian process.

Returns:
processGaussianProcess

The Gaussian process \vect{W} with its the optimized parameters.

getCholeskyFactor()

Accessor to the Cholesky factor of the covariance matrix.

Returns:
LTriangularMatrix

Cholesky factor \mat{L}_{\vect{p}^*} of the covariance matrix, which can be written \mat{L}_{\vect{p}^*} \mat{L}_{\vect{p}^*}^T.

getClassName()

Accessor to the object’s name.

Returns:
class_namestr

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

getCovarianceModel()

Accessor to the covariance model.

Returns:
covModelCovarianceModel

The covariance model of the Gaussian process \vect{W} with its optimized parameters.

getHMatCholeskyFactor()

Accessor to the Cholesky factor of the covariance matrix.

Only available with HMat algebra.

Returns:
LHMatrix

Cholesky factor \mat{L}_{\vect{p}^*} of the covariance matrix, which can be written \mat{L}_{\vect{p}^*} \mat{L}_{\vect{p}^*}^T.

getInputSample()

Accessor to the input sample.

Returns:
inputSampleSample

The input sample.

getLinearAlgebraMethod()

Accessor to the linear algebra method used to fit.

Returns:
linAlgMethodint

The used linear algebra method to fit the model:

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

  • ot.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()

Output sample noise variance accessor.

Returns:
noisesequence of CovarianceMatrix

The noise covariance for each output: \mat{\Sigma}_i^{noise} \in \cM_{\outputDim \times \outputDim}(\Rset).

Notes

The noise takes into account the fact that the output values of the function are not known precisely. This noise is modeled by normal distribution with zero mean and a covariance matrix \mat{\Sigma}_i^{noise} as defined in (1).

Refer to Gaussian process regression to understand how it acts on the likelihood of the Gaussian process.

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.

Notes

The regression matrix, e.g the evaluation of the basis functions upon the input design sample. It contains \sampleSize lines and as many column as the size of the functional basis. The column k is defined as:

\left(\varphi_k(\vect{x}_1), \dots,\varphi_k(\vect{x}_\sampleSize) \right).

getStandardizedOutput()

Accessor to the standardized output.

Returns:
rhoPoint

Standardized output vector.

Notes

The standardized output vector is defined as \mat{L}_{\vect{p}^*}^{-1}(\vect{y} - \vect{m}_{\vect{\beta}^*(\vect{p}^*)}).

getTrendCoefficients()

Accessor to the trend coefficients.

Returns:
trendCoefPoint

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

Notes

As the same basis is used for each marginal output, each \vect{\beta}^\ell vector is of dimension b, the size of the functional basis.

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.

setNoise(noise)

Output sample noise variance accessor.

Parameters:
noisesequence of CovarianceMatrix

The noise covariance \mat{\Sigma_{\epsilon}}.

setOutputSample(sampleY)

Accessor to the output sample.

Parameters:
outputSampleSample

The output sample.

setStandardizedOutput(rho)

Accessor to the standardized output.

Parameters:
rhosequence of float

Standardized output vector.

Notes

The standardized output vector is defined as \mat{L}_{\vect{p}^*}^{-1}(\vect{y} - \vect{m}_{\vect{\beta}^*(\vect{p}^*)}).

Examples using the class

Gaussian Process Regression vs KrigingAlgorithm

Gaussian Process Regression vs KrigingAlgorithm

Gaussian Process Regression: multiple input dimensions

Gaussian Process Regression: multiple input dimensions

Gaussian Process Regression : quick-start

Gaussian Process Regression : quick-start

Advanced Gaussian process regression

Advanced Gaussian process regression

Gaussian Process Regression: choose an arbitrary trend

Gaussian Process Regression: choose an arbitrary trend

Gaussian Process Regression: choose a polynomial trend on the beam model

Gaussian Process Regression: choose a polynomial trend on the beam model

Gaussian Process Regression : cantilever beam model

Gaussian Process Regression : cantilever beam model

Gaussian Process Regression: choose a polynomial trend

Gaussian Process Regression: choose a polynomial trend

Gaussian process fitter: configure the optimization solver

Gaussian process fitter: configure the optimization solver

Gaussian process regression: draw the likelihood

Gaussian process regression: draw the likelihood

Gaussian Process Regression: nugget effect and noise

Gaussian Process Regression: nugget effect and noise

Gaussian Process Regression: Normalization for optimization

Gaussian Process Regression: Normalization for optimization

Gaussian Process Regression : generate trajectories from the metamodel

Gaussian Process Regression : generate trajectories from the metamodel

Gaussian Process Regression: metamodel of the Branin-Hoo function

Gaussian Process Regression: metamodel of the Branin-Hoo function

Multi-output Gaussian Process Regression on the fire satellite model

Multi-output Gaussian Process Regression on the fire satellite model

Gaussian Process Regression: propagate uncertainties

Gaussian Process Regression: propagate uncertainties

Create a general linear model metamodel

Create a general linear model metamodel