Skip to content

Commit

Permalink
Merge pull request #777 from dritchie/dev
Browse files Browse the repository at this point in the history
Discrete dist entropy calculation should use ad.
  • Loading branch information
stuhlmueller committed Feb 19, 2017
2 parents c5f62d8 + 2aa1c3d commit e76e04f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/dists.ad.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ var finiteSupport = {
},

entropy: function() {
'use ad';
return _.reduce(this.support(), function(memo, x) {
var score = this.score(x);
return memo - (score === -Infinity ? 0 : Math.exp(score) * score);
Expand Down

0 comments on commit e76e04f

Please sign in to comment.