3
$\begingroup$

I have a full-conditional of the form : $$ p(X|...) \propto \exp(-(aX^2 +bX +c/X)), $$ All of the other full-conditionals of my model simplify to a simpler form and for a sake of simplicity, I would like to instantiate my model using Jags or WinBugs (which means that I need to explicit a form for $p(X|...)$ and that I cannot use explicitly a Metropolis step for $p(X|)$ (I think)).

Is it possible to do this? If so, how?

$\endgroup$
3
  • $\begingroup$ Could you tell us anything about the likely values of $a$, $b$, $c$, and $X$? For some ranges of these values, this function is very close to Gaussian (but in others it is actually bimodal). $\endgroup$
    – whuber
    Nov 7, 2012 at 16:36
  • $\begingroup$ Is the whole term over $X$ or simply $c$? In the first case, it is an inverse Gaussian distribution. $\endgroup$
    – Xi'an
    Nov 7, 2012 at 20:59
  • $\begingroup$ whuber: I am investigating for typical values. Xi'an: I do not understand what you mean. can you please develop ? $\endgroup$
    – peuhp
    Nov 8, 2012 at 8:32

2 Answers 2

0
$\begingroup$

In addition to darrenjw answer, you can use Metropolis step for your conditional: such modification is called Metropolis-within-Gibbs algorithm. It is perfectly valid. In facto, all yout conditionals can have no-analytical form, instead for each conditional you perform Metropolis algorithm. WinBUGS does not allow you to specify you algorithm explicitly. You just state the model, and he will do it for you - but not necesserily the best choice will be made.

$\endgroup$
12
  • $\begingroup$ I am note sure to know how to implement this part of my model in Jags (I guess it would be the same in WinBugs). Eventually, I need to specify a distribution for X and It seems to me that one are limitated to distribution proposed by the software. Do you agree with that ? I am aware of the one/zero trick but it seems unsatistactory in my case. $\endgroup$
    – peuhp
    Nov 14, 2012 at 19:15
  • $\begingroup$ zero-one trick is for sampling distribution (maybe i'm wrong). I think, you can implement any sampling distribution with this trick. Anyway,why do you want force Jags/BUGS to do Gibbs sampling? I do not think that it is possible. You can specify your data model, but not the MCMC algorithm. It selects it according to its own rules. If you want specifically to implement Gibbs sampling, I would suggest to do it in R language or Matlab or any other similar software. $\endgroup$
    – Tomas
    Nov 15, 2012 at 14:28
  • $\begingroup$ I must be missing something about Jags (I guess it is the same for BUGS). Let's simply say my model is : $$ p(y_i|X_i=x_i,A=a) \propto \exp(-(ax_i^2 +ax_i +a/x_i)), $$ with $$ X_i \sim U(1,10) $$ $$ A \sim U(0,10) $$ I do not know how to infer $p(A,(X_i)|(Y_i))$ in Jags naturally (I thought it is not possible). How can we do ? Thanks in advance. $\endgroup$
    – peuhp
    Nov 20, 2012 at 12:01
  • $\begingroup$ Now I am confused: why do you want sampling a random variable from distribution, which does not depend on that random variable? Did you wanted to write as follows? $$p(X_{i}|a) \propto exp(-(ax_{i}^{2}+ax_{i}+a/x_{i}))$$ In this case, winbugs code for defining this distribution by zero trick can be found here: users.aims.ac.za/~mackay/BUGS/Manuals/Tricks.html where $L[i]=-(ax_{i}^{2}+ax_{i}+a/x_{i})$ $\endgroup$
    – Tomas
    Nov 20, 2012 at 12:29
  • $\begingroup$ Sorry I do not know what i was thinking about but you guess my model! The fact is that the zero-tricks seems to me a very sophisticated and maybe unefficient way to "target a density" (maybe I am wrong) while a simple metropolis step will be quite natural. The one trick is not equivalent to a Metroplis step, is it ? $\endgroup$
    – peuhp
    Nov 20, 2012 at 16:42
0
$\begingroup$

If you are using Jags or WinBUGS you just describe the model and the software will figure out how to do the sampling. For a non-standard full-conditional such as this, the software will use a Metropolis step rather than a Gibbs step.

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