3
$\begingroup$

I have been using JAGS but I am not quite sure how it actually simulates it values. I need to know in a general sense what's going on in the background.

$\endgroup$
7
$\begingroup$

There are several tools used by JAGS and/or BUGS.

Where conjugate distributions are used, straight Gibbs sampling is done. When that's not the case, adaptive rejection, slice sampling, or Metropolis-Hastings might be used (this is the case with BUGS at least; I believe it would be the case for JAGS as well).

You can examine the source code yourself and see exactly what it's doing in various circumstances. Also check out the discussion and the wiki.

Martyn Plummer's jags blog also has useful information: http://martynplummer.wordpress.com/

$\endgroup$
  • $\begingroup$ I followed the links but could find nothing that answered the OP's question. $\endgroup$ – idontgetoutmuch Jun 5 '14 at 6:52
  • 1
    $\begingroup$ @Dominic The OP's question is "what's going on in the background". One of the major statistical tools JAGS uses is mentioned in the first paragraph of my answer (and it's really only the statistical aspect that's on topic). Examining the source code (navigating from the page at the second link to here for the actual 1.6 Mb tarball) which shows exactly what's going on. I'm mystified what more you could want, but you're certainly free to post a new question that details what you want to find out. $\endgroup$ – Glen_b -Reinstate Monica Jun 5 '14 at 8:15
  • $\begingroup$ I probably misinterpreted the question but I thought the OP was asking about the G for Gibbs in JAGS [otherwise wouldn't it be called JASS - Just Another Slice Sampler :-)] and I am probably being fussy but I think one should have a specification other than the source code. This looks more apposite (to me at any rate): puma.isti.cnr.it/dfdownloadnew.php?ident=/cnr.isti/…. $\endgroup$ – idontgetoutmuch Jun 5 '14 at 8:37
  • $\begingroup$ Dominic: If you believe you have a better answer, could you post it? $\endgroup$ – Glen_b -Reinstate Monica Jun 5 '14 at 8:45
  • $\begingroup$ I accept your challenge :-) but as you say the question is somewhat vague. The question I will answer is why Gibbs sampling works and I will give a few examples using Haskell, JAGS and STAN. Of course without understanding the internals of JAGS which you point out it perfectly possible given enough time, one cannot really say what it is actually doing. In terms of understanding what is going on, I feel one is on firmer ground with STAN as it uses Hamiltonian Monte Carlo. I have a feeling that JAGS knows about conjugate distributions and uses slice sampling if they are not available. $\endgroup$ – idontgetoutmuch Jun 12 '14 at 8:31
2
$\begingroup$

According to the JAGS documentation,

A report on the samplers chosen by the model, and the stochastic nodes they act on, can be generated using the “SAMPLERS TO” command.

It seems that the user can't control the choice of sampler, which is automatically chosen by JAGS, as described in the manual. I'd say that typically, it will choose a slice sampler. Again, to quote the documentation,

Slice sampling [Neal, 2003] is the “work horse” sampling method in JAGS.

$\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.