From 735b17d79e6ece7c06d8ed85f8c9c6aa4889b29b Mon Sep 17 00:00:00 2001 From: James Phillips Date: Mon, 12 Sep 2016 09:38:09 +0000 Subject: [PATCH] Fitting target LNQREL internal ratio can be negative, used abs() --- IModel.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/IModel.py b/IModel.py index 76416df..66ba718 100644 --- a/IModel.py +++ b/IModel.py @@ -492,7 +492,7 @@ def CalculateAllDataFittingTarget(self, inCoeffs): # see http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2635088 if self.fittingTarget == "LNQREL": - Q = self.modelPredictions / self.dataCache.allDataCacheDictionary['DependentData'] + Q = numpy.abs(self.modelPredictions / self.dataCache.allDataCacheDictionary['DependentData']) sumsqlogQ = numpy.sum(numpy.square(numpy.log(Q))) val = sumsqlogQ if numpy.isfinite(val):