From 3c6bbf28d7022771dfe0e4b121da3810688e9a9c Mon Sep 17 00:00:00 2001 From: "Dr. Kashif Rasul" Date: Mon, 6 Apr 2020 11:38:35 +0200 Subject: [PATCH] scale alpha so that the var stays the same --- pts/modules/distribution_output.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pts/modules/distribution_output.py b/pts/modules/distribution_output.py index ad08783..f1c9582 100644 --- a/pts/modules/distribution_output.py +++ b/pts/modules/distribution_output.py @@ -136,8 +136,8 @@ class NegativeBinomialOutput(DistributionOutput): mu, alpha = distr_args if scale is not None: - mu *= scale - alpha /= scale + alpha = (1 - scale + mu*alpha)/(mu*scale*scale) + mu = mu*scale n = 1.0 / alpha p = mu * alpha / (1.0 + mu * alpha)