To explain my problem, I will start right away with a simplified example:

Assume we can measure "happiness" in the range of 0 (totally unhappy) to 1 (perfectly happy). We have these measurements for morning, noon and evening time.

There are 5 different factors, contributing to happiness: level of hunger, fun, social relations, strangury and tiredness. Now I want to know how much each of these factors contributes to overall happiness. Knowing the values of all factors, I can calculate hapiness, but it's a black box model and I don't know how it behaves (that's what the sensitivity analysis is there for).

Example: in the morning I have hunger = 0.6, fun = 0.2, social relations = 0.4, strangury = 0.9 and tiredness = 0.1 --> Happiness = 0.3;

At noon: hunger = 0.8, fun = 0.7, social relations = 0.8, strangury = 0.3, tiredness = 0.4 -> Happiness = 0.5

What I can easily do is vary one parameter (e.g. hunger) from min to max, leaving the others unchanged and watch happiness change (calculate the range, standard deviation, mean/median). I calculate this for morning, noon and evening. The same I do for all other parameters individually. What I get is a local sensitivity analysis and in the end I will know which of the factors has what kind of impact on happiness for a given time of the day.

But now what if strangury is even worse for happiness if there is hunger involved, too? What if social relations do not have an impact, unless fun tends to be very low? Both examples are just relationships between TWO parameters, but what if they all interact with each other?

For morning, noon and evening, I want to know the share of influence for each factor. They are understood as the individual influence + influence via interactions.

I have been thinking about this problem for quite a long time, but I can't get my head around it. I think a principal component analysis could be involved, but I'm not sure.

By the way, I am doing this in python 2.7 if that's relevant for your answers.

Thank you!


1 Answer 1


If you have enough data, you can try using variance-based indices aka Sobol indices to measure the influence of a couple of variables. This method is part of the Global Sensitivity Analysis methods, which aim at finding how the uncertainty in the output of a model (numerical or otherwise) can be apportioned to different sources of uncertainty in the model input

Sobol' indices are based on the decomposition of the variance of your black-box model as the sum of variances. enter image description here

You can find more about it in this document or here. As you decompose the variance into terms linked to one variable, two variables, 3 variables... you can find the influence of each of these sets of variables independently.

Numerically, there are several methods to estimate those indices among which those based on Monte Carlo sampling and spectral decomposition (FAST among others) are the most frequently used.

An important point with Sobol indices is that you cannot use it if input variables are dependent (hunger, fun, etc.).

It seems that SALib package can do it in python. (Note that the sobol package does not compte Sobol indices but the Sobol series which is unrelated ;)). Otherwise, the sensitivity package in R is great for this kind of things.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.