Examples

var continous_erp_3d = ParticleFilter(function() {
  return {
    X: beta(1, 1),
    Y: beta(10, 10),
    Z: beta(.1, .1)
  }
}, 1000);
vizPrint(continous_erp_3d);
var discrete_erp_3d = Enumerate(function() {
  return {
    who: categorical([1, 1, 1, 1, 1, 1], ["Plum", "Peacock", "White", "Scarlet", "Mustard", "Green"]),
    where: categorical([1, 3, 5, 2, 4], ["candlestick", "knife", "revolver", "rope", "poison"]),
    with_what: categorical([1, 1, 1, 1, 1], ["dining", "kitchen", "hall", "conservatory", "library"])
  }
});
vizPrint(discrete_erp_3d);
var discrete_erp_2d = Enumerate(function() {
  return {
    fruit: categorical([0.1, 0.2, 0.3, 0.4], ["apple", "banana", "orange", "grape"]),
    boolean: flip(0.7)
  }
});
vizPrint(discrete_erp_2d);
var continous_erp_2d = ParticleFilter(function() {
  return {
    X: gaussian(0, 1),
    Y: gaussian(0, 1)
  }
}, 1000);
vizPrint(continous_erp_2d);
var continuous_erp = ParticleFilter(function() { return gaussian(0, 1); }, 1000);
vizPrint(continuous_erp);
var discrete_erp = Enumerate(function() { return flip(0.9) ? "apple" : "orange"; });
vizPrint(discrete_erp);