From 2e0098db369f349fc7d03da7c145359112aaf927 Mon Sep 17 00:00:00 2001 From: "per.andreas.brodtkorb" Date: Tue, 8 Nov 2011 18:03:04 +0000 Subject: [PATCH] Updated _nnlf() --- pywafo/src/wafo/stats/distributions.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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)