EMAworkbench icon indicating copy to clipboard operation
EMAworkbench copied to clipboard

Consider using Scipy stats.qmc module for Quasi-Monte Carlo samplers

Open EwoutH opened this issue 2 years ago • 3 comments

In SciPy 1.7.0 one of the most massive PRs in SciPy history was merged, https://github.com/scipy/scipy/pull/10844. This PR added the scipy.stats.qmc submodule, which provides Quasi-Monte Carlo generators and associated helper functions. The qmc submodule is still developed and optimized.

It might be worth investigating if porting some of the EMAworkbench samplers (either the built-in samplers from samplers.py or the imported ones in salib_samplers.py). Sobol, Halton and LatinHypercube are likely candidates.

EwoutH avatar May 09 '22 12:05 EwoutH

check the TODO under sampling, its on the list.

One issue is that I am hesitant to change any sampler that is related to SALIB because its analysis functions are tied to its sampling functions.

quaquel avatar May 09 '22 12:05 quaquel

On a bit broader note, scikit-optimize also has functions for Hammersly sampling and different optimized Latin hypercube sampling methods, such as centered LHS, Maximin optimized LHS and Correlation optimized LHS, which could be interesting to support.

PySMO, as part of the idaes-pse package, might also be interesting to look at

EwoutH avatar Jun 15 '22 09:06 EwoutH

I hope to overhaul the sampling sometime in the not-so-distant future. I want to give the user more control over how factors (i.e., uncertainties and levers) are sampled and how samples of subsets of factors are combined. Currently, uncertainties and levers are sampled separately and next combined in a factorial manner. However, for example, when doing a Sobol analysis, you might want to sample the uncertainties and levers jointly. You now have to do this in a bit of a hacky sort of way. See lake_model_sample_jointly.py for an example.

As part of this overhaul and associated modifications or additions to the API, it would be good to check the broader landscape of experimental design and sampling in Python.

quaquel avatar Jun 16 '22 06:06 quaquel