SALib / SALib

Sensitivity Analysis Library in Python. Contains Sobol, Morris, FAST, and other methods.
http://SALib.github.io/SALib/
MIT License
866 stars 234 forks source link

Support temporal SA (aka time-varying SA) #525

Open ConnectedSystems opened 2 years ago

ConnectedSystems commented 2 years ago

It would be nice to support sensitivity analysis over time "out of the box"

tupui commented 2 years ago

I can see 2 ways of doing it. 1. add support for every methods and use vectorisation where it can be used. 2. Make a wrapper that (decorator or standalone function) that would work on any analize method. Here you can parallelize this outer loop.

willu47 commented 2 years ago

A few ideas - is this the same as wanting to conduct an SA over several outputs (e.g. a number of different result parameters). If so, then there are two very similar use cases that could be served - I suggest creating a wrapper which could be implemented in different ways for different approaches.

A useful feature could be helper plots showing

tupui commented 2 years ago

I would say it's similar. You could have a model that output a quantity of interest over a spatial/temporal domain, or multiple QoI. Hence it should be similar and the same approach could be used as long as you consider elements to be independent. e.g. no spatial correlation taken into account.

ConnectedSystems commented 2 years ago

I have a tentative prototype already, although the implementation is not clean and is external to SALib currently. (I have to blur the info as I'm not sure how much I can share at the moment).

The example applies PAWN to each time step for a specified Quantity of Interest (QoI). I'm using a heatmap here as I have a large number of factors.

This is applied naively with no parallelization. Parallelization would be easy to do given we now have the infrastructure in place to do this.

This is with the higher-level interface of course - akin to @tupui 's option 2. I'm assuming people who want to use the lower-level API directly want to/able to do this by themselves.

image

For the somewhat opposite case of plotting the sensitivity of multiple QoIs to a single factor, perhaps a ribbon plot? (something similar, in style, to this: https://user-images.githubusercontent.com/37084259/58433167-c8ea3300-80ad-11e9-91dd-40ccfa2b9d71.png)