Closed peterhurford closed 1 year ago
Instead of hardcoding it for certain distributions, we can apply the more general Cholesky transformation on sampling. See here. I can give this a try, but I'm not a statistician, and we might want some feedback from one.
@peterhurford what do you think?
@agucova Looks awesome!
https://github.com/rethinkpriorities/squigglepy/issues/45 may be related
@peterhurford I've talked with Jaime from Epoch, and they've told me they've been using copula-based methods as well. The way I've implemented the Iman-Conover method should be mathematically equivalent to the normal copula method, but copulas can be more flexible in certain situations.
In particular, I've noticed the IC method struggles with discrete distributions because there's often not enough variability in the samples themselves for a reorder to be able to induce a certain correlation. I'm not sure if we can fix this with copulas, but it might be a good next step.
One potential idea: https://stackoverflow.com/questions/18683821/generating-random-correlated-x-and-y-points-using-numpy