GaussianProcessConditionalCovariance¶
- class GaussianProcessConditionalCovariance(*args)¶
- Conditional covariance post processing of a Gaussian Process Regression result. - Warning - This class is experimental and likely to be modified in future releases. To use it, import the - openturns.experimentalsubmodule.- Parameters:
- gprResultGaussianProcessRegressionResult
- The result class built by - GaussianProcessRegression.
 
- gprResult
 - Methods - Accessor to the object's name. - getConditionalCovariance(*args)- Compute the conditional covariance of the Gaussian process on a point (or several points). - 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. - Compute the diagonal conditional covariance of the Gaussian process on a point. - Compute the conditional covariance of the Gaussian process on a sample. - getName()- Accessor to the object's name. - hasName()- Test if the object is named. - setName(name)- Accessor to the object's name. - Notes - Refer to Gaussian process regression (step 3) to get all the notations and the theoretical aspects. We only detail here the notions related to the class. - We suppose we have a sample - where - for all k, with - the model. The Gaussian process approximation - is defined by: - where - is the trend function and - is a Gaussian process of dimension - with zero mean and a specified covariance function. The Gaussian process regression denoted by - is defined by: - where - is the condition - for - . - The class provides services related to the conditional covariance of the Gaussian process regression - . - Examples - Create the model - and the samples: - >>> import openturns as ot >>> from openturns.experimental import GaussianProcessRegression >>> from openturns.experimental import GaussianProcessConditionalCovariance >>> trend = ot.SymbolicFunction(['x'], ['1']) >>> sampleX = [[1.0], [2.0], [3.0], [4.0], [5.0], [6.0]] >>> sampleY = trend(sampleX) - Create the algorithm: - >>> covarianceModel = ot.SquaredExponential([1.0]) >>> covarianceModel.setActiveParameter([]) - >>> algo = GaussianProcessRegression(sampleX, sampleY, covarianceModel, trend) >>> algo.run() >>> result = algo.getResult() >>> condCov = GaussianProcessConditionalCovariance(result) >>> c = condCov([1.1]) - __init__(*args)¶
 - 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). - 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 (N can be equal to 1). 
 
- Returns:
- condCovCovarianceMatrix
- The conditional covariance of the Gaussian process regression - defined in (2) at point - is defined in (5). When computed on the sample - , the covariance matrix is defined in (6). 
 
- condCov
 
 - getConditionalMarginalVariance(*args)¶
- Compute the conditional variance of the Gaussian process on a point (or several points). - 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 (N can be equal to 1). 
- marginalIndexint
- Marginal of interest (for multiple outputs). - Default value is 0 (first component). 
- marginalIndicessequence of int
- Marginals of interest (for multiple outputs). 
 
- Returns:
- varfloat
- The variance of the specified marginal of the Gaussian process regression - defined in (2) at the specified point. 
- varPointsequence of float
- The marginal variances of each marginal of interest computed at each given point. 
 
 - Notes - If only one marginal - of interest and one point - have been specified, the method returns - where - is the Gaussian process regression defined in (2). - If several marginal of interest - or several points - have been specified, the method returns the concatenation of sequence of variances - for each - . 
 - getConditionalMean(*args)¶
- Compute the conditional mean of the Gaussian process on a point or a sample of points. - 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 (N can be equal to 1). 
 
- Returns:
 
 - getDiagonalCovariance(xi)¶
- Compute the diagonal conditional covariance of the Gaussian process on a point. - Parameters:
- xsequence of float
- The point - where the conditional marginal covariance of the output has to be evaluated. 
 
- Returns:
- condCovCovarianceMatrix
- The conditional covariance - at point - . 
 
- condCov
 
 - getDiagonalCovarianceCollection(xi)¶
- Compute the conditional covariance of the Gaussian process on a sample. - Parameters:
- sampleX2-d sequence of float
- The sample - where the conditional marginal covariance of the output has to be evaluated (N can be equal to 1). 
 
- Returns:
- condCovCovarianceMatrixCollection
- The collection of conditional covariance matrices - for - defined in (6). 
 
- condCov
 - Notes - Each element of the collection corresponds to the conditional covariance with respect to the input learning set (e.g. a pointwise evaluation of the getDiagonalCovariance). The returned collection is of size - and contains matrices in - . 
 - getName()¶
- Accessor to the object’s name. - Returns:
- namestr
- The name of the object. 
 
 
 - hasName()¶
- Test if the object is named. - Returns:
- hasNamebool
- True if the name is not empty. 
 
 
 - setName(name)¶
- Accessor to the object’s name. - Parameters:
- namestr
- The name of the object. 
 
 
 
Examples using the class¶
Gaussian Process-based active learning for reliability
Gaussian Process Regression: surrogate model with continuous and categorical variables
Gaussian Process Regression: choose a polynomial trend
Gaussian Process Regression: metamodel of the Branin-Hoo function
Sequentially adding new points to a Gaussian Process metamodel
 OpenTURNS
      OpenTURNS