Skip to content

Commit

Permalink
Fix bug in Exponential score function.
Browse files Browse the repository at this point in the history
Closes probmods#883.
  • Loading branch information
null-a committed Sep 25, 2017
1 parent 220b948 commit 6320c21
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/dists/exponential.ad.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ var Exponential = base.makeDistributionType({
},
score: function(val) {
'use ad';
return Math.log(this.params.a) - this.params.a * val;
return val >= 0 ?
Math.log(this.params.a) - this.params.a * val :
-Infinity;
},
base: function() {
return new Uniform({a: 0, b: 1});
Expand Down

0 comments on commit 6320c21

Please sign in to comment.