Guest User

Untitled

a guest
Nov 21st, 2017
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. def convert_params(mu, theta):
  2. """
  3. Convert mean/dispersion parameterization of a negative binomial to the ones scipy supports
  4.  
  5. See https://en.wikipedia.org/wiki/Negative_binomial_distribution#Alternative_formulations
  6. """
  7. var = mu + theta * mu ** 2
  8. p = (var - mu) / var
  9. return theta, 1 - p
Add Comment
Please, Sign In to add comment