# 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 and .

metaModelFunction

The meta model: , defined in (3).

residualsPoint

The residual errors.

relativeErrorsPoint

The relative errors.

basiscollection of Basis

Collection of the functional basis: for each with . Its size must be equal to zero if the trend is not estimated.

trendCoefficientscollection of Point

The trend coeffient vectors .

covarianceModelCovarianceModel

Covariance function of the Gaussian process.

covarianceCoefficients2-d sequence of float

The defined in (2).

covarianceCholeskyFactorTriangularMatrix

The Cholesky factor of .

covarianceHMatrixHMatrix

The hmat implementation of .

Notes

The Kriging meta model is defined by:

(1) where is the condition for each .

Equation (1) writes: where and

(2) At the end, the meta model writes:

(3) Examples

Create the model 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

 __call__(self, \*args) Call self as a function. Accessor to the collection of basis. getClassName(self) Accessor to the object’s name. getConditionalCovariance(self, \*args) Compute the expected covariance of the Gaussian process on a point (or several points). getConditionalMarginalCovariance(self, \*args) Compute the expected covariance of the Gaussian process on a point (or several points). getConditionalMarginalVariance(self, \*args) Compute the expected variance of the Gaussian process on a point (or several points). getConditionalMean(self, \*args) Compute the expected mean of the Gaussian process on a point or a sample of points. Accessor to the covariance coefficients. Accessor to the covariance model. getId(self) Accessor to the object’s id. getInputSample(self) Accessor to the input sample. getMetaModel(self) Accessor to the metamodel. getModel(self) Accessor to the model. getName(self) Accessor to the object’s name. Accessor to the output sample. Accessor to the relative errors. getResiduals(self) Accessor to the residuals. getShadowedId(self) Accessor to the object’s shadowed id. Accessor to the normalizing transformation. Accessor to the trend coefficients. getVisibility(self) Accessor to the object’s visibility state. hasName(self) Test if the object is named. hasVisibleName(self) Test if the object has a distinguishable name. setMetaModel(self, metaModel) Accessor to the metamodel. setModel(self, model) Accessor to the model. setName(self, name) Accessor to the object’s name. setRelativeErrors(self, relativeErrors) Accessor to the relative errors. setResiduals(self, residuals) Accessor to the residuals. setShadowedId(self, id) Accessor to the object’s shadowed id. setTransformation(self, transformation) Accessor to the normalizing transformation. setVisibility(self, visible) Accessor to the object’s visibility state.
__init__(self, \*args)

Initialize self. See help(type(self)) for accurate signature.

getBasisCollection(self)

Accessor to the collection of basis.

Returns
basisCollectioncollection of Basis

Collection of the function basis: for each with .

Notes

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

getClassName(self)

Accessor to the object’s name.

Returns
class_namestr

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

getConditionalCovariance(self, \*args)

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

Available usages:

getConditionalCovariance(x)

getConditionalCovariance(sampleX)

Parameters
xsequence of float

The point where the conditional covariance of the output has to be evaluated.

sampleX2-d sequence of float

The sample where the conditional covariance of the output has to be evaluated (M can be equal to 1).

Returns
condCovCovarianceMatrix

The conditional covariance at point . Or the conditional covariance matrix at the sample : where .

getConditionalMarginalCovariance(self, \*args)

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

Available usages:

getConditionalMarginalCovariance(x)

getConditionalMarginalCovariance(sampleX)

Parameters
xsequence of float

The point where the conditional marginal covariance of the output has to be evaluated.

sampleX2-d sequence of float

The sample where the conditional marginal covariance of the output has to be evaluated (M can be equal to 1).

Returns
condCovCovarianceMatrix

The conditional covariance at point .

condCovCovarianceMatrixCollection

The collection of conditional covariance matrices at each point of the sample :

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(self, \*args)

Compute the expected 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 where the conditional variance of the output has to be evaluated.

sampleX2-d sequence of float

The sample 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(self, \*args)

Compute the expected 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 where the conditional mean of the output has to be evaluated.

sampleX2-d sequence of float

The sample where the conditional mean of the output has to be evaluated (M can be equal to 1).

Returns
condMeanPoint

The conditional mean at point . Or the conditional mean matrix at the sample : getCovarianceCoefficients(self)

Accessor to the covariance coefficients.

Returns
covCoeffSample

The defined in (2).

getCovarianceModel(self)

Accessor to the covariance model.

Returns
covModelCovarianceModel

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

getId(self)

Accessor to the object’s id.

Returns
idint

Internal unique identifier.

getInputSample(self)

Accessor to the input sample.

Returns
inputSampleSample

The input sample.

getMetaModel(self)

Accessor to the metamodel.

Returns
metaModelFunction

Metamodel.

getModel(self)

Accessor to the model.

Returns
modelFunction

Physical model approximated by a metamodel.

getName(self)

Accessor to the object’s name.

Returns
namestr

The name of the object.

getOutputSample(self)

Accessor to the output sample.

Returns
outputSampleSample

The output sample.

getRelativeErrors(self)

Accessor to the relative errors.

Returns
relativeErrorsPoint

The relative errors defined as follows for each output of the model: with the vector of the model’s values and the metamodel’s values.

getResiduals(self)

Accessor to the residuals.

Returns
residualsPoint

The residual values defined as follows for each output of the model: with the model’s values and the metamodel’s values.

getShadowedId(self)

Accessor to the object’s shadowed id.

Returns
idint

Internal unique identifier.

getTransformation(self)

Accessor to the normalizing transformation.

Returns
transformationFunction

The transformation T that normalizes the input sample.

getTrendCoefficients(self)

Accessor to the trend coefficients.

Returns
trendCoefcollection of Point

The trend coefficients vectors getVisibility(self)

Accessor to the object’s visibility state.

Returns
visiblebool

Visibility flag.

hasName(self)

Test if the object is named.

Returns
hasNamebool

True if the name is not empty.

hasVisibleName(self)

Test if the object has a distinguishable name.

Returns
hasVisibleNamebool

True if the name is not empty and not the default one.

setMetaModel(self, metaModel)

Accessor to the metamodel.

Parameters
metaModelFunction

Metamodel.

setModel(self, model)

Accessor to the model.

Parameters
modelFunction

Physical model approximated by a metamodel.

setName(self, name)

Accessor to the object’s name.

Parameters
namestr

The name of the object.

setRelativeErrors(self, relativeErrors)

Accessor to the relative errors.

Parameters

The relative errors defined as follows for each output of the model: with the vector of the model’s values and the metamodel’s values.

setResiduals(self, residuals)

Accessor to the residuals.

Parameters
residualssequence of float

The residual values defined as follows for each output of the model: with the model’s values and the metamodel’s values.

setShadowedId(self, id)

Accessor to the object’s shadowed id.

Parameters
idint

Internal unique identifier.

setTransformation(self, transformation)

Accessor to the normalizing transformation.

Parameters
transformationFunction

The transformation T that normalizes the input sample.

setVisibility(self, visible)

Accessor to the object’s visibility state.

Parameters
visiblebool

Visibility flag.