Sunday, October 5, 2008

Further Bayesian adventures

I am quite busy at the moment. But I recently got some inspiration for pushing forward with the development of my object-oriented Bayesian-inference package. The inspiration came in the form of the recently released R-packages rv By Kerman and Gelman. A technical report by the same authors provided me with the initial idea for starting this package. The rv package implements part of what intend to implement in my Bayesian package, and I am inclined to borrow some Ideas from it as I improve my Python package. I want to extend what is already available in rv with support for posterior derivation using natural conjugate priors, support for approximate bayes computation methods, etc. Let's just see If I can find the time...

6 comments:

jsalvati said...

Have you seen PyMC (http://code.google.com/p/pymc/)? I have not explored the package in depth, but it looks pretty interesting.

jsalvati said...

er, I suppose I should say it's for doing Bayesian inference using MCMC in Python.

Unknown said...

Yes, I have played with it mabe a year ago. They seem to have just release a 2.0 version of the package, so I'll take a look at it again.

Their goals are not exactly the same as mine which are closer to Gelman's rv R package.

anand said...

We haven't implemented the rv package's syntax in PyMC, but I don't think it would be an uncomfortable fit in 2.0.

Specifically, the PyMC class that represents random variables is called 'variable'. It has subclasses 'stochastic' and 'deterministic', which are analogous to WinBugs' 'stochastic' and 'logical'. Variable could be given __add__, __mul__, etc. methods that return deterministic objects, and our RNG functions could be decorated to accept variables.

Unknown said...

HI Anand,

I haven't had time to check out the new PyMC since (as of last week at least) there was not 2.0 package for Linux and just now I decided to get the code from SVN to try it.

Anyway, congratulations for the great effort You all have put into the documentation for the 2.0 realease!

I wonder in what direction you want to take PyMC in: Make it into a python Winbugs, or develop a more generic bayesian analysis package?

best,

Flávio

anand said...

Hi Flávio,

We definitely want PyMC to be a generic Bayesian analysis package. Ideally you should be able to create a model, then fit it with any of several algorithms.

Currently all we have is MCMC, maximum a posteriori estimates and the normal approximation, and MCMC has received the lion's share of effort... but we've tried not to privilege it in PyMC's basic design.

Let us know if you have any comments on the docs.

Cheers,
Anand

ccp

Amazon