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 36eeb2d commit 735b17d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion IModel.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 735b17d

Please sign in to comment.