popsim-consortium / stdpopsim

A library of standard population genetic models
GNU General Public License v3.0
122 stars 86 forks source link

support for different parametrizations of the gamma distribution #980

Open mufernando opened 3 years ago

mufernando commented 3 years ago

https://en.wikipedia.org/wiki/Gamma_distribution

SLiM parametrizes the gamma distribution in DFE with mean (alphabeta or ktheta, where alpha=k and beta=1/theta) and shape parameters.

however, most papers report alpha and beta (scale and rate). to make it easier for people to add DFE to the catalog I propose we follow R's convention (shape + rate or scale) https://stat.ethz.ch/R-manual/R-patched/library/stats/html/GammaDist.html

ping @petrelharp @RyanGutenkunst @izabelcavassim @grahamgower

grahamgower commented 3 years ago

SLiM also allows negative numbers for the mean, which produce a reflected gamma distribution. Perhaps this is an important factor in how/why the gamma is parameterised in SLiM?

izabelcavassim commented 3 years ago

if from dadi to slim annotation we need to also request the user the ancestral population size (Na), since: E[s] = -shape x scale x 2/(2Na)

petrelharp commented 3 years ago

Sure, either way. I vote against SLiM's shorthand for "negative mean implies deleterious", though.