GaussianProcessFitterResult¶
- class GaussianProcessFitterResult(*args)¶
Gaussian process fitter result.
Refer to Gaussian process regression.
- Parameters:
- inputSample, outputSample
Sample The samples
and
.
- metaModel
Function The metamodel:
, defined in (1) by the trend function.
- regressionMatrix
Matrix The regression matrix, e.g the evaluation of the basis functions upon the input design sample.
- basis
Basis Functional basis of size
:
for
. Its size should be equal to zero if the trend is not estimated.
- trendCoefsequence of float
The trend coefficients vectors
.
- covarianceModel
CovarianceModel 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.
- inputSample, outputSample
Methods
getBasis()Accessor to the basis.
Accessor to the Gaussian process.
Accessor to the Cholesky factor of the covariance matrix.
Accessor to the object's name.
Accessor to the covariance model.
Accessor to the Cholesky factor of the covariance matrix.
Accessor to the input sample.
Accessor to the linear algebra method used to fit.
Accessor to the metamodel.
getName()Accessor to the object's name.
getNoise()Output sample noise variance accessor.
Accessor to the optimal log-likelihood of the model.
Accessor to the output sample.
Accessor to the regression matrix.
Accessor to the standardized output.
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.
Accessor to the standardized output.
setCholeskyFactor
Notes
The structure is usually created by the method
run()of the classGaussianProcessFitterand obtained with its methodgetResult().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
defined by the estimated trend function:
(1)¶
with
and
the trend functions for
and
.
Examples
Create the model
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 = 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:
- basis
Basis Functional basis to estimate the trend:
.
- basis
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:
- process
GaussianProcess The Gaussian process
with its the optimized parameters.
- process
- getCholeskyFactor()¶
Accessor to the Cholesky factor of the covariance matrix.
- Returns:
- L
TriangularMatrix Cholesky factor
of the covariance matrix, which can be written
.
- L
- getClassName()¶
Accessor to the object’s name.
- Returns:
- class_namestr
The object class name (object.__class__.__name__).
- getCovarianceModel()¶
Accessor to the covariance model.
- Returns:
- covModel
CovarianceModel The covariance model of the Gaussian process
with its optimized parameters.
- covModel
- getHMatCholeskyFactor()¶
Accessor to the Cholesky factor of the covariance matrix.
Only available with HMat algebra.
- Returns:
- L
HMatrix Cholesky factor
of the covariance matrix, which can be written
.
- L
- 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.
- 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:
.
- noisesequence of
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
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.
- getRegressionMatrix()¶
Accessor to the regression matrix.
- Returns:
- process
Matrix Returns the regression matrix.
- process
Notes
The regression matrix, e.g the evaluation of the basis functions upon the input design sample. It contains
lines and as many column as the size of the functional basis. The column
is defined as:
- getStandardizedOutput()¶
Accessor to the standardized output.
- Returns:
- rho
Point Standardized output vector.
- rho
Notes
The standardized output vector is defined as
.
- getTrendCoefficients()¶
Accessor to the trend coefficients.
Notes
As the same basis is used for each marginal output, each
vector is of dimension
, 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:
- inputSample
Sample The input sample.
- inputSample
- 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
.
- noisesequence of
- setOutputSample(sampleY)¶
Accessor to the output sample.
- Parameters:
- outputSample
Sample The output sample.
- outputSample
- setStandardizedOutput(rho)¶
Accessor to the standardized output.
- Parameters:
- rhosequence of float
Standardized output vector.
Notes
The standardized output vector is defined as
.
Examples using the class¶
Gaussian Process Regression: multiple input dimensions
Gaussian Process Regression: choose an arbitrary trend
Gaussian Process Regression: choose a polynomial trend on the beam model
Gaussian Process Regression : cantilever beam model
Gaussian Process Regression: choose a polynomial trend
Gaussian process fitter: configure the optimization solver
Gaussian Process Regression: nugget effect and noise
Gaussian Process Regression: Normalization for optimization
Gaussian Process Regression : generate trajectories from the metamodel
Gaussian Process Regression: metamodel of the Branin-Hoo function
Multi-output Gaussian Process Regression on the fire satellite model
Gaussian Process Regression: propagate uncertainties
OpenTURNS