# How to solve multidimensional input variables in Sobol (M > 20)?

Hello all,
Recently, I am working on a practical case based on Sobol sensitivity analysis, The response model and probability input model are as follows:
Y=((-X1+X19-8X24-X13+450(X11+X17)+8*(X12+X6+X18)-X7).^2+(-X2+X20+200X24-X14+450(X10+X16)+400*(X12+X6+X18)-X8).^2+(X21+8X22-200X23-X3-X15-8*(X10+X4+X16)-400*(X11+X5+X17)-X9).^2).^(0.5);

InputOpts.Marginals(1).Name = ‘X1’;
InputOpts.Marginals(1).Type = ‘uniform’;
InputOpts.Marginals(1).Parameters = [0 0.029206];
InputOpts.Marginals(2).Name = ‘X2’;
InputOpts.Marginals(2).Type = ‘uniform’;
InputOpts.Marginals(2).Parameters = [0 0.0364];
InputOpts.Marginals(3).Name = ‘X3’;
InputOpts.Marginals(3).Type = ‘uniform’;
InputOpts.Marginals(3).Parameters = [0 0.011321];
InputOpts.Marginals(4).Name = ‘X4’;
InputOpts.Marginals(4).Type = ‘uniform’;
InputOpts.Marginals(4).Parameters = [0 6.0629E-5];
InputOpts.Marginals(5).Name = ‘X5’;
InputOpts.Marginals(5).Type = ‘uniform’;
InputOpts.Marginals(5).Parameters = [0 3.052E-5]; InputOpts.Marginals(6).Name = ‘X6’;
InputOpts.Marginals(6).Type = ‘uniform’;
InputOpts.Marginals(6).Parameters = [0 4.5717E-5];
InputOpts.Marginals(7).Name = ‘X7’;
InputOpts.Marginals(7).Type = ‘uniform’;
InputOpts.Marginals(7).Parameters = [0 0.020339];
InputOpts.Marginals(8).Name = ‘X8’;
InputOpts.Marginals(8).Type = ‘uniform’;
InputOpts.Marginals(8).Parameters = [0 0.048608];
InputOpts.Marginals(9).Name = ‘X9’;
InputOpts.Marginals(9).Type = ‘uniform’;
InputOpts.Marginals(9).Parameters = [0 0.011826];
InputOpts.Marginals(10).Name = ‘X10’;
InputOpts.Marginals(10).Type = ‘uniform’;
InputOpts.Marginals(10).Parameters = [0 6.3456E-5];
InputOpts.Marginals(11).Name = ‘X11’;
InputOpts.Marginals(11).Type = ‘uniform’;
InputOpts.Marginals(11).Parameters = [0 4.31E-5];
InputOpts.Marginals(12).Name = ‘X12’;
InputOpts.Marginals(12).Type = ‘uniform’;
InputOpts.Marginals(12).Parameters = [0 5.7912E-5];
InputOpts.Marginals(13).Name = ‘X13’;
InputOpts.Marginals(13).Type = ‘uniform’;
InputOpts.Marginals(13).Parameters = [0 0.013859];
InputOpts.Marginals(14).Name = ‘X14’;
InputOpts.Marginals(14).Type = ‘uniform’;
InputOpts.Marginals(14).Parameters = [0 0.047617];
InputOpts.Marginals(15).Name = ‘X15’;
InputOpts.Marginals(15).Type = ‘uniform’;
InputOpts.Marginals(15).Parameters = [0 0.010174];
InputOpts.Marginals(16).Name = ‘X16’;
InputOpts.Marginals(16).Type = ‘uniform’;
InputOpts.Marginals(16).Parameters = [0 5.8166E-5];
InputOpts.Marginals(17).Name = ‘X17’;
InputOpts.Marginals(17).Type = ‘uniform’;
InputOpts.Marginals(17).Parameters = [0 3.4953E-5];
InputOpts.Marginals(18).Name = ‘X18’;
InputOpts.Marginals(18).Type = ‘uniform’;
InputOpts.Marginals(18).Parameters = [0 5.6287E-5];
InputOpts.Marginals(19).Name = ‘X19’;
InputOpts.Marginals(19).Type = ‘uniform’;
InputOpts.Marginals(19).Parameters = [0 0.014194];
InputOpts.Marginals(20).Name = ‘X20’;
InputOpts.Marginals(20).Type = ‘uniform’;
InputOpts.Marginals(20).Parameters = [0 0.025789];
InputOpts.Marginals(21).Name = ‘X21’;
InputOpts.Marginals(21).Type = ‘uniform’;
InputOpts.Marginals(21).Parameters = [0 0.048935];
InputOpts.Marginals(22).Name = ‘X22’;
InputOpts.Marginals(22).Type = ‘uniform’;
InputOpts.Marginals(22).Parameters = [0 5.662E-5];
InputOpts.Marginals(23).Name = ‘X23’;
InputOpts.Marginals(23).Type = ‘uniform’;
InputOpts.Marginals(23).Parameters = [0 4.6306E-5];
InputOpts.Marginals(24).Name = ‘X24’;
InputOpts.Marginals(24).Type = ‘uniform’;
InputOpts.Marginals(24).Parameters = [0 4.4639E-5];

The analysis results show some errors:

(a) The estimation of PCE coefficients stopped at polynomial degree 5 and qNorm 1.00 for output variable 1
Final LOO error estimate: 4.281862e-01

(b) Warning: LRA based indices can’t be efficiently computed for large dimensional problems (M>20)
switching back to MCS Sobol indices estimators…

However, I have 24 input variables. How can I solve this problem?
In addition, I don’t quite understand metaopts.expdesign, sampling type: the default option is MC. If I want to change to Sobol sequence sampling, which file should I modify?

I hope to hear from you at your convenience!
Best regards
FANFAN

Hi @FANFAN,

I will try to answer your questions regarding the PCE. I am not so practical with the LRA

The estimation of PCE coefficients stopped at polynomial degree 5 and qNorm 1.00 for output variable 1: you can set the metamodel such that it will not stop at the first degree with a lower LOO error. You can set this as

``````metaOpts.DegreeEarlyStop = false;
``````

By default, the value is set to `true`, and it will stop the search at the local minimum of the error. If you need more support, maybe you can paste part of your code.

The experimental design: once you define your input, as you wrote in your question, you need to specify the input object

``````myInput = uq_createInput(InputOpts);
``````

and then you can collect a sample from it, with the sampling technique you prefer, as

``````X = uq_getSample(myInput,<method>);
% where <method>: 'mc','lhs','Sobol', or 'Halton'
``````