Showing posts with label MCMC. Show all posts
Showing posts with label MCMC. Show all posts

Thursday, June 18, 2015

Nimble

Just discovered this little package for Bayesian analysis. I think it is on the right direction. I hope it handle discrete parameters better than Stan.

Sunday, March 16, 2014

MCMC in LaplacesDemon

LaplacesDemon is a really cool package but I had a hard time to grasp its full capacity. This article summarizes provides a nice summary.

Tuesday, June 25, 2013

Faster Gibbs sampling MCMC from within R

I find this comparison of MCMC performance between different languages helpful.

After generating a .class file from the java source, I need to add the following two lines of code to make it work:

.jaddClassPath("/home/shige/mydata/test/Gibbs/out/production/Gibbs") 
.jaddClassPath("/home/shige/bin/java/parallelcolt-0.9.4.jar") 

Saturday, October 01, 2011

Updated examples that combine Rcpp and CppBugs

This example is very informative in illustrating how to use CppBugs module with Rcpp to conduct fast MCMC simulation in R.

Saturday, August 27, 2011

Using Rcpp for faster MCMC simulation

Here is a very informative blog post showing how to use Rcpp to speed up MCMC simulation.

Sunday, July 17, 2011

Dong MCMC using Rcpp

Here is an interesting example.

Wednesday, April 13, 2011

Laplace's Demon

This is a serious attempt to code a general purpose MCMC sampling engine in R.

Wednesday, November 03, 2010

CppBUGS

The CppBUGS project is really interesting. I hope it can be tightly integrated with R.

Friday, April 09, 2010

GLMM using DPpackage

I was able to fit a semi-parametric Bayesian GLMM model using DPpackage. It took me many hours to sample from the posterior distribution (DPM prior):

MCMC scan 1000 of 5000 (CPU time: 18950.080 s)
MCMC scan 2000 of 5000 (CPU time: 22510.100 s)
MCMC scan 3000 of 5000 (CPU time: 28293.830 s)
MCMC scan 4000 of 5000 (CPU time: 35111.930 s)
MCMC scan 5000 of 5000 (CPU time: 46726.330 s)

Which translates to 5.26, 6.25, 9.75, 12.98 hours. This makes it less suitable for routine (especially exploratory) data analysis.

I compared the results from DPpackage and that from MCMCglmm, and they are not that different, and the latter took only a small fraction of the time required by the former!

The lack of difference in results puzzled me. I compared from results from random effect logistic regression assuming Gaussian random effect and results from NPML, assuming a nonparametric distribution of the random effect, the differences are quite significant.

---------------------------- UPDATED ON APRIL 11 ----------------------------------------------------------------

Using DP prior instead of DPM prior, it took about 4.7 hours to run the model. The results are slightly different and the parameter I am interested in increased from .41 to .42. Now I am trying PT prior and see how it goes.

DPpackage is a exciting new tool for applied researchers, and A LOT OF new and cool things can be done with it. With convenient new Bayesian tools like MCMCpack, MCMCglmm, and DPpackage, I will not be surprised to see more Bayesian publications coming out in social sciences. 

Saturday, January 30, 2010

An example of MCMCglmm

Here is a very useful example of how to estimate multinomial logit with random effect using MCMCglmm package.

Counter