Skip to content

Instantly share code, notes, and snippets.

@stuhlmueller
Created January 18, 2016 20:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stuhlmueller/4bf0c2e5e0f30aef15a8 to your computer and use it in GitHub Desktop.
Save stuhlmueller/4bf0c2e5e0f30aef15a8 to your computer and use it in GitHub Desktop.
var model = function() {
var x = uniform(0,1);
var yERP = Enumerate(function(){
return flip(x);
})
var y = sample(yERP);
return x + y;
}
MCMC(model, { kernel: { HMC: { steps: 10, stepSize: 1 }},
samples: 1000 });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment