m-d-grunnill / MetaCast

A package for broadcasting epidimiological and ecological models over metapopulations.
Apache License 2.0
1 stars 1 forks source link

Latin Hypercube sampling only supports uniform distributions #6

Closed robmoss closed 4 days ago

robmoss commented 1 week ago

Hi @m-d-grunnill I noticed the following comment in §5.2 of the demonstration notebook:

"Note currently metacast only support latin hypercube sampling with uniform distributions."

I feel that this is a relatively important limitation, and it should probably be mentioned elsewhere (e.g., README.md).

End users can circumvent this limitation by sampling from the unit interval, and using inverse-CDF functions to then sample from their desired distributions (e.g., using the ppf() method of scipy.stats distributions). So while this is a limitation of the MetaCast package, it still allows users to sample from arbitrary distributions. You could highlight this in §5.2 of the notebook (and maybe in README.md).

Would it be relatively simple to allow users to provide ppf() methods for each parameter? (I'm asking out of interest, not in th expectation that you'll do this as part of the JOSS review).

Aside: I maintain a Latin hypercube sampling package (imaginatively named lhs) that supports sampling from arbitrary distributions, and defining "dependent distributions" whose shape parameters can be functions of the samples drawn for other parameters. Distributions can be defined in a number of ways.

m-d-grunnill commented 4 days ago

This note was in the documentation for the lhs_prcc function as well. But to make this limitation more explicit to users I have put a further note in the README.md file.

I don't think users can currently circumvent this issue using the lhs_prcc function. Therefore, I am opening this up in a new enhancement issue, to keep it separate from the JOSS corrections.