KrigingResult

class KrigingResult(*args)

Kriging result.

Available constructors:

KrigingResult(inputSample, outputSample, metaModel, residuals, relativeErrors, basis, trendCoefficients, covarianceModel, covarianceCoefficients)

KrigingResult(inputSample, outputSample, metaModel, residuals, relativeErrors, basis, trendCoefficients, covarianceModel, covarianceCoefficients, covarianceCholeskyFactor, covarianceHMatrix)

Parameters:
inputSample, outputSample2-d sequence of float

The samples (\vect{x}_k)_{1 \leq k \leq N} \in \Rset^d and (\vect{y}_k)_{1 \leq k \leq N}\in \Rset^p.

metaModelFunction

The meta model: \tilde{\cM}: \Rset^d \rightarrow \Rset^p, defined in (3).

residualsPoint

The residual errors.

relativeErrorsPoint

The relative errors.

basisBasis

Functional basis of size b : (\varphi^l: \Rset^d \rightarrow \Rset^p) for each l \in [1, b]. Its size should be equal to zero if the trend is not estimated.

trendCoefficientsPoint

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

covarianceModelCovarianceModel

Covariance function of the Gaussian process.

covarianceCoefficients2-d sequence of float

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

covarianceCholeskyFactorTriangularMatrix

The Cholesky factor \mat{L} of \mat{C}.

covarianceHMatrixHMatrix

The hmat implementation of \mat{L}.

Notes

The 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, N].

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}_N))}\vect{\gamma}

where

\Cov{\vect{Y}(\omega, \vect{x}), (\vect{Y}(\omega, \vect{x}_1),\dots,\vect{Y}(\omega, \vect{x}_N))} = \left(\mat{C}(\vect{x},\vect{x}_1)|\dots|\mat{C}(\vect{x},\vect{x}_N)\right)\in \cM_{p,NP}(\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}^N \gamma_i  \mat{C}(\vect{x},\vect{x}_i)

Examples

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

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

Create the algorithm:

>>> basis = ot.Basis([ot.SymbolicFunction(['x'], ['x']), ot.SymbolicFunction(['x'], ['x^2'])])
>>> covarianceModel = ot.GeneralizedExponential([2.0], 2.0)
>>> algoKriging = ot.KrigingAlgorithm(sampleX, sampleY, covarianceModel, basis)
>>> algoKriging.run()

Get the result:

>>> resKriging = algoKriging.getResult()

Get the meta model:

>>> metaModel = resKriging.getMetaModel()

Methods

getBasis()

Accessor to the functional basis.

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.

getCovarianceCoefficients()

Accessor to the covariance coefficients.

getCovarianceModel()

Accessor to the covariance model.

getInputSample()

Accessor to the input sample.

getMetaModel()

Accessor to the metamodel.

getName()

Accessor to the object's name.

getOutputSample()

Accessor to the output sample.

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.

__init__(*args)
getBasis()

Accessor to the functional basis.

Returns:
basisBasis

Functional basis of size b : (\varphi^l: \Rset^d \rightarrow \Rset^p) for each l \in [1, b].

Notes

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

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).

Available usages:

getConditionalCovariance(x)

getConditionalCovariance(sampleX)

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).

Available usages:

getConditionalMarginalCovariance(x)

getConditionalMarginalCovariance(sampleX)

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).

Available usages:

getConditionalMarginalVariance(x, marginalIndex)

getConditionalMarginalVariance(sampleX, marginalIndex)

getConditionalMarginalVariance(x, marginalIndices)

getConditionalMarginalVariance(sampleX, marginalIndices)

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.

Available usages:

getConditionalMean(x)

getConditionalMean(sampleX)

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)

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 with its optimized parameters.

getInputSample()

Accessor to the input sample.

Returns:
inputSampleSample

The input sample.

getMetaModel()

Accessor to the metamodel.

Returns:
metaModelFunction

Metamodel.

getName()

Accessor to the object’s name.

Returns:
namestr

The name of the object.

getOutputSample()

Accessor to the output sample.

Returns:
outputSampleSample

The output sample.

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:
trendCoefPoint

The trend coefficients vectors (\vect{\alpha}^1, \dots, \vect{\alpha}^p) stored 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

Kriging : multiple input dimensions

Kriging : multiple input dimensions

Kriging : draw the likelihood

Kriging : draw the likelihood

Kriging : cantilever beam model

Kriging : cantilever beam model

Kriging: choose an arbitrary trend

Kriging: choose an arbitrary trend

Kriging the cantilever beam model using HMAT

Kriging the cantilever beam model using HMAT

Example of multi output Kriging on the fire satellite model

Example of multi output Kriging on the fire satellite model

Kriging : generate trajectories from a metamodel

Kriging : generate trajectories from a metamodel

Kriging: choose a polynomial trend on the beam model

Kriging: choose a polynomial trend on the beam model

Kriging with an isotropic covariance function

Kriging with an isotropic covariance function

Kriging: metamodel of the Branin-Hoo function

Kriging: metamodel of the Branin-Hoo function

Kriging : quick-start

Kriging : quick-start

Sequentially adding new points to a kriging

Sequentially adding new points to a kriging

Kriging: configure the optimization solver

Kriging: configure the optimization solver

Kriging: choose a polynomial trend

Kriging: choose a polynomial trend

Advanced Kriging

Advanced Kriging

Kriging: metamodel with continuous and categorical variables

Kriging: metamodel with continuous and categorical variables