Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to add new distributions #1

Open
faraway1nspace opened this issue Aug 5, 2012 · 10 comments
Open

Ability to add new distributions #1

faraway1nspace opened this issue Aug 5, 2012 · 10 comments

Comments

@faraway1nspace
Copy link

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?

@armstrtw
Copy link
Owner

armstrtw commented Aug 6, 2012

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:
#1

@stla
Copy link

stla commented Feb 20, 2014

I'd like to have the Wishart distribution. I have not understand how I could add it myself.

@armstrtw
Copy link
Owner

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.

@stla
Copy link

stla commented Feb 23, 2014

What examples are you talking about ? Do you mean I take the code of a function such as mcmc.normal and I modify it ?

@armstrtw
Copy link
Owner

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.

@alienscience
Copy link

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?

@armstrtw
Copy link
Owner

armstrtw commented May 3, 2015

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?

@RobertMyles
Copy link

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.

@armstrtw
Copy link
Owner

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.

@RobertMyles
Copy link

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants