Compute grouped indices for the Ishigami function

In this example, we compute grouped Sobol’ indices for the Ishigami function.

from openturns.usecases import ishigami_function
import openturns as ot

We load the Ishigami test function from usecases module:

The IshigamiModel data class contains the input distribution of the random vector \vect{X}=\Tr{(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 a training sample.

Create the chaos.

Print Sobol’ indices.

FunctionalChaosSobolIndices
  • input dimension: 3
  • output dimension: 1
  • basis size: 26
  • mean: [3.50804]
  • std-dev: [3.70043]
Input Variable Sobol' index Total index
0 X1 0.313447 0.555260
1 X2 0.444616 0.444775
2 X3 0.000057 0.241886
Index Multi-index Part of variance
7 [0,4,0] 0.279938
1 [1,0,0] 0.190322
6 [1,0,2] 0.136823
15 [0,6,0] 0.130033
5 [3,0,0] 0.120580
11 [3,0,2] 0.083746
3 [0,2,0] 0.025026
12 [1,0,4] 0.011187


We compute the first order indice of the group [0,1] .

0.7581141221738305

This group collects all the multi-indices containing variables only in this group, including interactions within the group (by decreasing order of significance):

  • [0,4,0] : 0.279938

  • [1,0,0] : 0.190322

  • [0,6,0] : 0.130033

  • [3,0,0] : 0.12058

  • [0,2,0] : 0.0250262

0.279938 + 0.190322 + 0.130033 + 0.12058 + 0.0250262
0.7458992

The difference between the previous sum and the output of getSobolGroupedIndex is lower than 0.01, which is the threshold used by the __str__ method.

We compute the total order indice of the group [1,2].

0.6865529054018151

This group collects all the multi-indices containing variables in this group, including interactions with variables outside the group:

  • [0,4,0] : 0.279938

  • [1,0,2] : 0.136823

  • [0,6,0] : 0.130033

  • [3,0,2] : 0.0837457

  • [0,2,0] : 0.0250262

  • [1,0,4] : 0.0111867

0.279938 + 0.136823 + 0.130033 + 0.0837457 + 0.0250262 + 0.0111867
0.6667526