Exemple #1
0
 def _logpmf(self, x, mu, alpha, p, w):
     s, p = self.convert_params(mu, alpha, p)
     return _lazywhere(x != 0, (x, s, p, w),
                       (lambda x, s, p, w: np.log(1. - w) + 
                       nbinom.logpmf(x, s, p)),
                       np.log(w + (1. - w) *
                       nbinom.pmf(x, s, p)))
Exemple #2
0
 def _logpmf(self, x, mu, alpha, p, w):
     s, p = self.convert_params(mu, alpha, p)
     return _lazywhere(x != 0, (x, s, p, w),
                       (lambda x, s, p, w: np.log(1. - w) +
                       nbinom.logpmf(x, s, p)),
                       np.log(w + (1. - w) *
                       nbinom.pmf(x, s, p)))
Exemple #3
0
 def _logpmf(self, x, mu, alpha, p, w):
     return _lazywhere(
         x != 0, (x, mu, alpha, p, w),
         (lambda x, mu, alpha, p, w: np.log(1. - w) + genpoisson_p.logpmf(
             x, mu, alpha, p)),
         np.log(w + (1. - w) * genpoisson_p.pmf(x, mu, alpha, p)))
Exemple #4
0
 def _logpmf(self, x, mu, w):
     return _lazywhere(x != 0, (x, mu, w), (lambda x, mu, w: np.log(
         1. - w) + x * np.log(mu) - gammaln(x + 1.) - mu),
                       np.log(w + (1. - w) * np.exp(-mu)))
Exemple #5
0
 def _logpmf(self, x, mu, alpha, p, w):
     return _lazywhere(x != 0, (x, mu, alpha, p, w),
                       (lambda x, mu, alpha, p, w: np.log(1. - w) + 
                       genpoisson_p.logpmf(x, mu, alpha, p)),
                       np.log(w + (1. - w) *
                       genpoisson_p.pmf(x, mu, alpha, p)))
Exemple #6
0
 def _logpmf(self, x, mu, w):
     return _lazywhere(x != 0, (x, mu, w),
                       (lambda x, mu, w: np.log(1. - w) + x * np.log(mu) -
                       gammaln(x + 1.) - mu),
                       np.log(w + (1. - w) * np.exp(-mu)))