Error: NAN results after performing Morris analysis

Dear all users,

I am tring to perform Morris sensitivity analysis now to select the most import input parameters. I have a total number of 20 independent parameters. I used a main program to describe the model and called during the sensitivity analysis.

I defined all the distribution types and descriptions of the parameters as follows:

clearvars;
uqlab;
rng(100)

MOpts.mFile = ‘a11’; % this is the model program
myModel = uq_createModel(MOpts);
Input.Copula.Type =‘Independent’;

IOpts.Marginals(1).Name = ‘ee’;
IOpts.Marginals(1).Type = ‘Uniform’;
IOpts.Marginals(1).Parameters = [0.01, 1];
IOpts.Marginals(1).Bounds = [0.01,1];

IOpts.Marginals(2).Name = ‘p(1)’;
IOpts.Marginals(2).Type = ‘Uniform’;
IOpts.Marginals(2).Parameters = [0, 1];
IOpts.Marginals(2).Bounds = [0,1];

IOpts.Marginals(3).Name = ‘p(2)’;
IOpts.Marginals(3).Type = ‘Uniform’;
IOpts.Marginals(3).Parameters = [0, 1];
IOpts.Marginals(3).Bounds = [0,1];

IOpts.Marginals(4).Name = ‘L(1)’; % Ramanathan(2010) page 10
IOpts.Marginals(4).Type = ‘Uniform’;
IOpts.Marginals(4).Parameters = [1, 25];
IOpts.Marginals(4).Bounds = [1,25];

IOpts.Marginals(5).Name = ‘L(2)’;
IOpts.Marginals(5).Type = ‘Uniform’;
IOpts.Marginals(5).Parameters = [1, 25];
IOpts.Marginals(5).Bounds = [1,25];

IOpts.Marginals(6).Name = ’ lambdaK(1)';
IOpts.Marginals(6).Type = ‘Uniform’;
IOpts.Marginals(6).Parameters = [0.1, 25];
IOpts.Marginals(6).Bounds = [0.1,25];

IOpts.Marginals(7).Name = ’ lambdaK(2)';
IOpts.Marginals(7).Type = ‘Uniform’;
IOpts.Marginals(7).Parameters = [0.1, 25];
IOpts.Marginals(7).Bounds = [0.1,25];

IOpts.Marginals(8).Name = ’ lambdaKd(1)';
IOpts.Marginals(8).Type = ‘Uniform’;
IOpts.Marginals(8).Parameters = [0.1, 25];
IOpts.Marginals(8).Bounds = [0.1,25];

IOpts.Marginals(9).Name = ‘lambdaKd(2)’;
IOpts.Marginals(9).Type = ‘Uniform’;
IOpts.Marginals(9).Parameters = [0.1, 25];
IOpts.Marginals(9).Bounds = [0.1,25];

IOpts.Marginals(10).Name = ‘mnK(1)’;
IOpts.Marginals(10).Type = ‘Gaussian’;
IOpts.Marginals(10).Parameters = [2.06, 0.47];
IOpts.Marginals(10).Bounds = [0, 4];

IOpts.Marginals(11).Name = ‘mnK(2)’;
IOpts.Marginals(11).Type = ‘Gaussian’;
IOpts.Marginals(11).Parameters = [1.22, 0.41];
IOpts.Marginals(11).Bounds = [0, 4];

IOpts.Marginals(12).Name = ‘mnKd(1)’;
IOpts.Marginals(12).Type = ‘Gaussian’;
IOpts.Marginals(12).Parameters = [-0.94, 0.69];
IOpts.Marginals(12).Bounds = [-3, 1];

IOpts.Marginals(13).Name = ‘mnKd(2)’;
IOpts.Marginals(13).Type = ‘Gaussian’;
IOpts.Marginals(13).Parameters = [-1.52, 0.55];
IOpts.Marginals(13).Bounds = [-3, 1];

IOpts.Marginals(14).Name = ‘sigK(1)’;
IOpts.Marginals(14).Type = ‘Uniform’;
IOpts.Marginals(14).Parameters = [0, 2];
IOpts.Marginals(14).Bounds = [0,2];

IOpts.Marginals(15).Name = ‘sigK(2)’;
IOpts.Marginals(15).Type = ‘Uniform’;
IOpts.Marginals(15).Parameters = [0, 2];
IOpts.Marginals(15).Bounds = [0,2];

IOpts.Marginals(16).Name = ‘sigKd(1)’;
IOpts.Marginals(16).Type = ‘Uniform’;
IOpts.Marginals(16).Parameters = [0, 2];
IOpts.Marginals(16).Bounds = [0,2];

IOpts.Marginals(17).Name = ‘sigKd(2)’;
IOpts.Marginals(17).Type = ‘Uniform’;
IOpts.Marginals(17).Parameters = [0, 2];
IOpts.Marginals(17).Bounds = [0,2];

IOpts.Marginals(18).Name = ‘a’;
IOpts.Marginals(18).Type = ‘Uniform’;
IOpts.Marginals(18).Parameters = [-1, 1];
IOpts.Marginals(18).Bounds = [-1,1];

IOpts.Marginals(19).Name = ‘J’;
IOpts.Marginals(19).Type = ‘Uniform’;
IOpts.Marginals(19).Parameters = [0.001, 0.01];
IOpts.Marginals(19).Bounds = [0.001,0.01];

IOpts.Marginals(20).Name = ‘por’;
IOpts.Marginals(20).Type = ‘Uniform’;
IOpts.Marginals(20).Parameters = [0.3, 0.4];
IOpts.Marginals(20).Bounds = [0.3,0.4];

myInput = uq_createInput(IOpts);

After performing the Morris analysis:
MorrisSensOpts.Type = ‘Sensitivity’;
MorrisSensOpts.Method = ‘Morris’;
MorrisSensOpts.Morris.Cost =10000;
MorrisAnalysis = uq_createAnalysis(MorrisSensOpts);

The resutls are all NAN:
Morris: Finished.

 Morris sensitivity indices:

   ee         p(1)       p(2)       L(1)       L(2)        lambdaK(1)   lambdaK(2)   lambdaKd(1)  lambdaKd(2)    

mu: NaN NaN NaN NaN NaN NaN NaN NaN NaN
mu*: NaN NaN NaN NaN NaN NaN NaN NaN NaN
sigma: NaN NaN NaN NaN NaN NaN NaN NaN NaN

Total cost (model evaluations): 9996

I have check the X and Y values and there are some ‘NaN’ in Y resutls. What kind of problems should it be and how can I fix it?

Many thanks in advance!

Dear @lydia

The fact that you are getting NaN in your output indicates that something is wrong in your model. Based on the information I have, I cannot tell you what the problem is. However, I would suggest that you first find out when you are getting NaN outputs (for which inputs). Perhaps your model is not defined for some input vectors, or you are having numerical problems. Once you know for which inputs this is the case, you can examine your model more closely at these inputs and try to locate the root cause.

I’m sorry that I can’t help better, but without even a minimal working example that can reproduce the issue, there is nothing I can do.

Best regards
Styfen

Dear Styfen,

Thank you so much for your answer. I have checked my model code and have modified it. Now the Morris analysis works well.

Now I have one more question: Is Morris analysis also a method that is strongly based on sample size? Because I have got different results with different [Morris.cost] and even different results with same [Morris.cost]. Thank you.

Best regards

lydia