0
$\begingroup$

I am looking for a tutorial type example that shows the step by step process sampling from a simple hierarchical model.

For example, I am trying to study the distribution of p in a Bernoulli experiment where I have a set of 10 data / observations (h[i]).

model {
  p ~ dunif( 0, 1 )
  for( i in 1 : 10)  {
    h[i] ~ dbern( p )
  }
}

I am not clear as to how the WinBUGS (or similar samplers) would generate the correct samples for p values given my h1-10.

Is there a paper or article that explain this?

$\endgroup$
1
$\begingroup$

You must try John K. Kruschke's Doing Bayesian Data Analysis. In section "7.1.1 A politician stumbles upon the Metropolis algorithm" it explains in very straightforward manner, using the analogy of the salesman trying to visit each customer who lives on different island, how exactly both Metropolis works. By using this island-hopping analogy he explains with many examples and illustrations in R, how does the Gibbs sampler works as well. It is a best book I've read about this problem so far.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.