m-d-grunnill / MetaCast

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

Expand Latin Hypercube sampling beyond uniform distribution #8

Open m-d-grunnill opened 4 days ago

m-d-grunnill commented 4 days ago

Currently the lhs_prcc function only supports sampling from the uniform distribution.

In a previous issue @robmoss mentioned his package lhs. This package may provide features for overcoming this issue.

robmoss commented 4 days ago

Good point, this isn't something that can be achieved with the current lhs_prcc() function. Hmm. One option would be to allow the parameters_df argument to take one of two forms:

  1. The currently supported option of a data frame that contains 'Lower Bound' and 'Upper Bound' columns, and is indexed by parameter name; or
  2. A dictionary that maps parameter names to ppf() functions that transform the uniform samples into any desired distribution.

Having a quick look through lhs_and_prcc.py, I think this could be achieved with relatively few modifications to the code — I've written a proof-of-concept as a PR if you're interested. Feel free to accept, reject, rewrite :smile: