Re: new to winbugs/openbugs
- From: "Anon." <bob.ohara@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 23 May 2006 17:06:09 +0300
David wrote:
Background: I don't know R and I've never used Winbugs or OpenBugs. IIf you have a new Mac with an Intel chip, then you can run OpenBUGS under Wine. BUGS is complied for Intel chips, so it won't run on an old Mac.
now want to solve a problem using MCMC. At the moment, I believe I can
do this with Gibbs Sampling (that is, without Metropolis-Hastings). I
have to decide whether to make the time investment of learning R (which
I also don't know) and some version of BUGS, or whether to write my own
program in C++. I would be grateful for advice. Other background is
that I use a Mac, so WinBugs could be a problem for me. I do have
Virtual PC in an old version, and I'm contemplating updating Virtual
PC---this is Microsoft software that lets one run Windows software
under Mac Os X.
You could also look at JAGS.
On a very cursory look, it seems as though the BUGS descriptions areNo, you only need to learn BUGS. The language is pretty simple, and there are lots of examples to help.
quite similar to R. But I don't know R. Do I need to learn R in order
to use BUGS effectively? I found the BUGS examples on the web page
somewhat opaque.
If s and t and adjacent pixels, e=e_{s,t} is a variable, depending on sI don't quite follow the description of your model: I'm not use to the physics terminology.
and t, and is either 0 or 1. \gamma is a constant. My Gibbs energy will
include (for fixed s and fixed t) terms like
e. (x_s -x_t)^2 + \gamma. e + q(x_s,x_t) + other terms not involving
e_{s,t}, x_s or x_t
and where q is quadratic but complicated. I would need a program to
work out q for any given s and t.
Essentially, e tells the x distribution to what extent big jumps
between x_s and x_t are tolerated.
(I don't think it will make any difference to readers of this
newsgroup, but q comes from a convolution of the image matrix with
another fairly substantial matrix.)
When I come to apply Gibbs Sampling, I believe (please correct me if
I'm wrong), that I will need to find the marginal probability that e is
0 or 1 (a coin flip, but the coin isn't fair). This involves finding
the parameters of some normal distributions.
I would be most grateful if someone could give me a very brief
description of what BUGS would do for me in this situation? Can BUGS
call a program to evaluate q? In principle, the coefficients of q could
be given by explicit formulas in terms of all the the variables being
held constant during the sampling of the Markov Random Field, but I
shudder to think how horrible and long such formulas would be. Once q
is known explicitly, one needs to integrate the corresponding two
variable normal distributions. Does BUGS do this?
BUGS works by writing things as either stochastic nodes (i.e. distributions) or logical nodes (i.e. deterministic functions), and them simulating the values of the stochastic nodes.
Can BUGS do symbolic manipulation, like Mathematica? Can one doBUGS can't, R has some symbolic manipulation, but it's not designed for that.
symbolic manipulation in R?
Whether you want to use BUGS (or JAGS) or code in C depends a bit. Obviously learning BUGS will take a bit of time, but if you think you'll find it useful in the future then it may be worth it. If it'll be a one-off, and you can see how to write the C code, then it might take less time to do it that way.
You might want to look at GeoBUGS as well (it comes with BUGS), it looks like you might have a problem related to geostatistics.
Bob
--
Bob O'Hara
Dept. of Mathematics and Statistics
P.O. Box 68 (Gustaf Hällströmin katu 2b)
FIN-00014 University of Helsinki
Finland
Telephone: +358-9-191 51479
Mobile: +358 50 599 0540
Fax: +358-9-191 51400
WWW: http://www.RNI.Helsinki.FI/~boh/
Journal of Negative Results - EEB: http://www.jnr-eeb.org
.
- Follow-Ups:
- Re: new to winbugs/openbugs
- From: David
- Re: new to winbugs/openbugs
- References:
- new to winbugs/openbugs
- From: David
- new to winbugs/openbugs
- Prev by Date: Re: Mann-Whitman: critical values by Monte Carlo
- Next by Date: Re: Discrete and continuous variable mixture
- Previous by thread: new to winbugs/openbugs
- Next by thread: Re: new to winbugs/openbugs
- Index(es):
Relevant Pages
|