diff --git a/pywafo/src/wafo/stats/distributions.py b/pywafo/src/wafo/stats/distributions.py index a71b689..71c2c15 100644 --- a/pywafo/src/wafo/stats/distributions.py +++ b/pywafo/src/wafo/stats/distributions.py @@ -2237,7 +2237,10 @@ class rv_continuous(rv_generic): return None def _nnlf(self, x, *args): - return -sum(self._logpdf(x, *args),axis=0) + loginf = -log(floatinfo.machar.xmin) + logpdf = self._logpdf(x, *args).clip(min= -loginf) + return -sum(logpdf, axis=0) + def nnlf(self, theta, x): ''' Return negative loglikelihood function, i.e., - sum (log pdf(x, theta),axis=0)