How to analyze the convergence in Sobol indices?

Hello, I am a newbie in UQlab. When I use Sobol indices for sensitivity analysis, such as using the meta-models PCE and LRA, how can I view the convergence process of FSI and TSI at the sampling scale. In addition, when using different sampling methods, I want to compare their convergence rates. What should I do? Any help will be appreciated!

Dear Fanfan

Thanks for using UQLab!

In a UQLab session, you can define as many polynomial chaos expansions / sensitivity analyses as you want. Every surrogate model or analysis has a specific variable name and the results stay in the workspace until you clear these variables.

So, if you want to compare the results of various PCE-based Sobol’ indices for different experimental designs (ED), you can simply use a loop over your scenarios, and:

  • create the experimental designs first (of various type, various size, etc.)
  • then, create a PCE for each of them and use a subsequent sensitivity analysis. Here, for each ED, you should use LAR with a vector of possible maximal degrees, and a vector of q-norms, so as to obtain the best PCE possible based on the available data.

Then you can post-process the results (read from the fields mySensPCE.Results) and prepare plots that are relevant to you. You’ll find relevant information in the example uq_Example_PCE_02_ExperimentalDesign.m and the sensitivity analysis examples uq_Example_Sensitivity_02_SobolIndices.m and uq_Example_Sensitivity_03_HighDimensionalSobol.m.

Note that you can define cell arrays of PCE models or sensitivity analysis within a loop, e.g.:

for k = 1: NED    % loop on the various experimental designs
   % define your PCE options 
   PCEOpts.blabla = ...;
   myPCE{k} = uq_createModel(PCEOpts);

   % define the PCE-Sobol options
   SobolOpts.Type = 'Sensitivity';
   SobolOpts.Method = 'Sobol';
   mySobolPCE{k} = uq_createAnalysis(SobolOpts);    % Works with the latest PCE defined, i.e.   myPCE{k} 

I hope this answers your questions.

Best regards

Dear Sudret

Recently I'm using Sobol indices for sensitivity analysis, since I am a beginner, I have encountered many problems as follows:

(1) If my function is Y = A1.*A2.*A3.*A4.*A5.*A6.*A7.*A8;

% Specify the marginals as follows:

InputOpts.Marginals(1).Name = ‘A1’;

InputOpts.Marginals(1).Type = ‘Weibull’;

InputOpts.Marginals(1).Parameters = [4862.79 28.265];

InputOpts.Marginals(2).Name = ‘A2’;

InputOpts.Marginals(2).Type = ‘Weibull’;

InputOpts.Marginals(2).Parameters = [3375.861 11.624];

InputOpts.Marginals(3).Name = ‘A3’;

InputOpts.Marginals(3).Type = ‘Weibull’;

InputOpts.Marginals(3).Parameters = [6099.995 53.45];

InputOpts.Marginals(4).Name = ‘A4’;

InputOpts.Marginals(4).Type = ‘Weibull’;

InputOpts.Marginals(4).Parameters = [5366.578 5.295];

InputOpts.Marginals(5).Name = ‘A5’;

InputOpts.Marginals(5).Type = ‘Weibull’;

InputOpts.Marginals(5).Parameters = [3819.373 18.749];

InputOpts.Marginals(6).Name = ‘A6’;

InputOpts.Marginals(6).Type = ‘Weibull’;

InputOpts.Marginals(6).Parameters = [24858.4 4.899];

InputOpts.Marginals(7).Name = ‘A7’;

InputOpts.Marginals(7).Type = ‘Weibull’;

InputOpts.Marginals(7).Parameters = [32157.717 9.886];

InputOpts.Marginals(8).Name = ‘A8’;

InputOpts.Marginals(8).Type = ‘Weibull’;

InputOpts.Marginals(8).Parameters = [6769.804 13.774];

When I use sobol, PCE and LRA, the sensitivity analysis result will change whenever the sample size is changed. What is the reason? I didn’t change the parameters in the PCE and LRA in the metamodel. Will this affect it?

(2)In the function, can I only determine the distribution function of each variable? Do you need other parameters?

I hope I can get your help and look forward to your reply at your convenience.

Best regards



To answer your questions:

In general, the sample size affects the results of Sobol’ sensitivity analysis. This might be obvious in the case of the indices estimation using Monte-Carlo simulation, but this also applies for the indices computed from PCE and LRA. In these cases, sample size affects the computation of the coefficients of either PCE and LRA metamodels. And because those coefficients are used directly to compute the Sobol’ indices, the value of the indices will change depending on the sample size (unless they have converged such that we don’t notice any meaningful difference). And it’s not just the size of the sample; keeping the same size, but with different design or random realization of the same design, will also in general affects the results of the Sobol’ indices.

So even if you keep all the other parameters to construct the PCE and LRA metamodels, the properties of the sample still affect the resulting Sobol’ indices.

Unless I misunderstood your original question, I guess we shouldn’t be surprised that sample size affects the results, otherwise there wouldn’t be convergence in Sobol’ indices (at the sampling scale) to analyze.

Hope this helps!

As for your second question, I am not sure I understand. What do you mean by only determine the distribution function? And what other parameters? Are you, by any chance referring to one of those marginals you put above?

    Hello@damarginal , thank you for your reply. The second question means in your Sobol 'sensitivity analysis case, when we conduct sensitivity analysis on a model, whether we only need to determine the distribution of variables, such as normal distribution, we can get the sensitivity of each parameter to the output.
    At present, I am doing sensitivity analysis of a series system model. My function is Y = A1. * A2. * A3. * A4. * A5. * A6. * A7. * A8. If I get the marginal distribution of each variable Ai (i=1,2,...,8), can I get the sensitivity of each Ai to Y?
   I look forward to your reply. Thank you very much.


Sobol’ sensitivity analysis is, in a way, a post-processing of uncertainty propagation (uncertain output due to uncertain input). Therefore to carry out sensitivity analysis, you need to fully specify the uncertainties associated with the inputs, at the very least, their the distribution and the associated parameters[1].

I don’t see how you can get a meaningful sensitivity results (at least not with Sobol’ indices) just by specifying the distribution of the uncertain inputs without the parameters. So if you say that the inputs are normally distributed, then you also need to specify both the mean and the variance of that normal distribution to do Sobol’ sensitivity analysis.

Let me know if you have further questions!

PS: Somehow your post is rendered strangely, if you need help formatting your post properly, also let me know :slight_smile:

  1. more advance cases might require you to specify the correlation structure as well. ↩︎