Skip to content

Commit

Permalink
Fitting target LNQREL internal ratio can be negative, used abs()
Browse files Browse the repository at this point in the history
  • Loading branch information
zunzun committed Sep 12, 2016
1 parent eea313e commit 94a5342
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions IModel.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@




# pyeq3 is a collection of equations expressed as Python classes
#
# Copyright (C) 2013 James R. Phillips
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit 94a5342

Please sign in to comment.