Ability to add new distributions
Hi Armstrtw,
Cppbugs looks very promising! Well done!
I was hoping you could give an example about how to add new distributions, such as Poisson, or Multivariate Normal, to cppbugs. I'm hoping that cppbugs proves more customizable than JAGS.
Related: any plans to add the above distributions yourself?
Sure. It's basically as simple as adding a new distribution class. The distribution class just needs to provide a method for calculating the log likelihood and override the default jumping methods if necessary (like positive only or integer only).
I'm on vacation through Aug 11th, but I'll send you an example when I get back.
Alternatively, just add your own based on one of the existing classes (like gamma): https://github.com/armstrtw/CppBugs/blob/master/cppbugs/distributions/mcmc.gamma.hpp
Additionally, I plan to add support for all the basic distribution types. Poisson is high on the list, so you may not have to wait long for it.
-Whit
On Sun, Aug 5, 2012 at 9:40 AM, faraway1nspace [email protected] wrote:
Hi Armstrtw,
Cppbugs looks very promising! Well done!
I was hoping you could give an example about how to add new distributions, such as Poisson, or Multivariate Normal, to cppbugs. I'm hoping that cppbugs proves more customizable than JAGS.
Related: any plans to add the above distributions yourself?
Reply to this email directly or view it on GitHub: https://github.com/armstrtw/rcppbugs/issues/1
I'd like to have the Wishart distribution. I have not understand how I could add it myself.
yes, it's there in the cpp library only. you can add it to the R package if you copy one of the other examples.
What examples are you talking about ? Do you mean I take the code of a function such as mcmc.normal and I modify it ?
Yes, exactly. Just add a wrapper for the distribution and rebuild the package.
Or, wait a few weeks and I'll try to add it. There are a few other distribution requests outstanding, so I have a bit of a backlog for updating the package.
I wanted to use multivariate normal but the rcppbugs package will not compile with the latest CppBugs. There seems to have been quite a few changes. Will there be a newer version of rcppbugs in the future?
yes. Rcppbugs needs to be updated per all the changes in the c++ backend.
Do you need to use it via R, or could you perhaps use the c++ version?
Hi Whit, I just thought I'd check in on some of the issues raised in this thread. Any chance of updating Rcppbugs to have multivariate normals? I have a multidimensional IRT model that takes forever in JAGS and I'd love to try it out in rcppbugs.
I've done a bunch of work on it, and the newer version is almost ready.
As much as I like my project. I think you should give STAN a shot.
they have done some pretty cool things w/ sampling.
Thanks for the reply, Whit. I think stan is great, but my data has plenty of NA, which seems to be a big headache in stan. Looking forward to the new version of rcppbugs!