Re: new to winbugs/openbugs



David wrote:
Background: I don't know R and I've never used Winbugs or OpenBugs. I
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.

If 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.

You could also look at JAGS.

On a very cursory look, it seems as though the BUGS descriptions are
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.

No, you only need to learn BUGS. The language is pretty simple, and there are lots of examples to help.

If s and t and adjacent pixels, e=e_{s,t} is a variable, depending on s
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?

I don't quite follow the description of your model: I'm not use to the physics terminology.

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 do
symbolic manipulation in R?

BUGS can't, R has some symbolic manipulation, but it's not designed for that.

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

.



Relevant Pages

  • Re: Commercials protraying PC 20 years ago
    ... much else and for having lots of bugs. ... Who do these Mac people think they're fooling? ... Windows, the annoying security alerts and dialogs, the fact that Macs allow ... PCs are known for running spreadsheets and not much else... ...
    (comp.sys.mac.advocacy)
  • Charlie Miller: OS X is easiest to hack
    ... Safari on the Mac is easier to exploit. ... anti-exploit mitigations you'd find in Windows. ... It?s clear that all three browsers have bugs. ...
    (comp.sys.mac.system)
  • Re: Commercials protraying PC 20 years ago
    ... much else and for having lots of bugs. ... and movie software, and you can upgrade your hardward easily to boot. ... Who do these Mac people think they're fooling? ... PCs are known for running spreadsheets and not much else... ...
    (comp.sys.mac.advocacy)
  • Re: More on caching and logging
    ... with Apple - GraphicConverter may equally be at fault for the crasher. ... My version of GC has never crashed and has no bugs that I'm aware of. ... And just because it crashed doesn't necessarily mean it's Mac OS X 10.4's ... expecting that an upgrade from 10.3.9 to 10.3.9 would not break any of ...
    (comp.sys.mac.system)
  • Re: How about porting LVS to FreeBSD
    ... > LVSis a widely used server cluster ... new bugs introduced that needed the version 1.1.9 to be quickly released ... to FreeBSD or use the BSD flavoured replacement for VRRP: ... than one MAC address for an interface. ...
    (freebsd-arch)