Skip to content

Commit

Permalink
Merge pull request #833 from null-a/categorical-helper
Browse files Browse the repository at this point in the history
Have categorical helper sample from Categorical rather than Discrete distribution.
  • Loading branch information
stuhlmueller committed Apr 21, 2017
2 parents 02fa610 + 7025a1a commit 65d5421
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 6 deletions.
1 change: 0 additions & 1 deletion src/dists.ad.js
Original file line number Diff line number Diff line change
Expand Up @@ -1504,7 +1504,6 @@ var Categorical = makeDistributionType({
{name: 'ps', desc: 'probabilities (can be unnormalized)', type: types.nonNegativeVectorOrRealArray},
{name: 'vs', desc: 'support', type: types.array(types.any)}],
wikipedia: true,
nohelper: true,
mixins: [finiteSupport],
constructor: function() {
'use ad';
Expand Down
5 changes: 0 additions & 5 deletions src/header.wppl
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@ var flip = function(p) {
return sample(Bernoulli(params));
};

var categorical = function(arg1, arg2) {
var params = util.isObject(arg1) ? arg1 : {ps: arg1, vs: arg2};
return params.vs[discrete(params.ps)];
};

var uniformDraw = function(arg) {
var vs = util.isObject(arg) ? arg.vs : arg;
if (vs.length == 0) {
Expand Down

0 comments on commit 65d5421

Please sign in to comment.