Get Sobol indices error from kriging with Openturns

119 Views Asked by At

I'm looking for a Python package which computes the Sobol' indices from a kriging model and which provides a confidence interval on these indices that takes into account both the meta-model and the Monte-Carlo errors. Is it possible to do this with OpenTURNS?

1

There are 1 best solutions below

0
On

It is indeed possible to compute Sobol' indices from a Kriging model with confidence intervals that take into account Kriging uncertainty in addition to the uncertainty of Sobol' indices estimators.

The trick is to sample from trajectories of the conditional Gaussian process. Assuming you have a KrigingResult object kri_res, and also that you have obtained an inputDesign from a SobolIndicesExperiment with given size, you can build the ConditionalGaussianProcess with:

import openturns as ot
conditional_gp = ot.ConditionalGaussianProcess(kri_res, ot.Mesh(inputDesign))

And then sample output designs corresponding to N different trajectories of the conditional Gaussian process:

outputDesigns = conditional_gp.getSample(N)

Then you can get the distribution of the estimator of the (here first order) Sobol' indices for each trajectory:

distributions = []
for i in range(N):
    algo = ot.SaltelliSensitivityAlgorithm(inputDesign, outputDesigns[i], size)
    dist = algo.getFirstOrderIndicesDistribution()
    distributions.append(dist)

In order to average out Kriging uncertainty, you can build the mixture of the distributions and an associated confidence interval:

mixture = ot.Mixture(distributions)
ci = mixture.computeBilateralConfidenceInterval(0.9)

Be careful, what you get this way is a domain which contains 90% of the probability mass of the joint distribution. If you want to get confidence intervals marginal by marginal, then you need to do:

intervals = []
for j in range(mixture.getDimension()):
    marginal = mixture.getMarginal(j)
    ci = marginal.computeBilateralConfidenceInterval(0.9)
    intervals.append(ci)