From 94a534217d61dad9ad08cb0a7e0a8cb41e27d609 Mon Sep 17 00:00:00 2001 From: James Phillips Date: Mon, 12 Sep 2016 09:39:10 +0000 Subject: [PATCH] Fitting target LNQREL internal ratio can be negative, used abs() --- IModel.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/IModel.py b/IModel.py index 7c42fd8..63d8d2a 100644 --- a/IModel.py +++ b/IModel.py @@ -1,7 +1,3 @@ - - - - # pyeq3 is a collection of equations expressed as Python classes # # Copyright (C) 2013 James R. Phillips @@ -492,7 +488,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):