SchisslerGroup / Bigsimr.jl

Simulate multivariate distributions with arbitrary marginals.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

More thorough testing of Pearson matching

adknudson opened this issue · comments

Test all conditions for Pearson matching. Currently there is the possibility that matching returns NaN when testing mixed distributions:

dA = NegativeBinomial(20, 0.1)
dB = Gamma(100, 4)
pearson_match(-0.9, dA, dB, convert=false)

Preliminary tests seem to show that it's an error with how far out one goes on the support of the discrete distribution (i.e. the 99th percentile vs. the 99.999th percentile). The latter with n=9 works for the above case. May need to do more testing to see if there is a good combination of control variables that works for a broad spectrum of distributions. Otherwise I may need to write a robust loop that retries with different parameters until a solution is found.

Pearson matching has been broken off into its own package (PearsonCorrelationMatch), so any further bugs should be reported there. The issue mentioned here has now been fixed, and the package is working more consistently.