Validate a polynomial chaos

In this example, we show how to perform the validation plot of a polynomial chaos for the Ishigami function.

from openturns.usecases import ishigami_function
import openturns as ot
import openturns.viewer as otv

Model description

We load the Ishigami test function from the usecases module :

The model contains the input distribution X=(X_1, X_2, X_3) in im.distribution and the Ishigami function in im.model. We also have access to the input variable names with

Create the chaos

We could use only the input and output training samples: in this case, the distribution of the input sample is computed by selecting the best distribution that fits the data.

Since the input distribution is known in our particular case, we instead create the multivariate basis from the distribution, that is three independent variables X_1 , X_2 and X_3 .

Validation of the metamodel

In order to validate the metamodel, we generate a test sample.

0.9992361845215688

The R^2 is very close to 1: the metamodel seems very accurate.

graph = val.drawValidation()
graph.setTitle("R2=%.2f%%" % (r2Score * 100))
view = otv.View(graph)
R2=99.92%

The metamodel has a good predictivity, since the points are almost on the first diagonal.

Display all figures