Implementation of a Gibbs-Metropolis sampling algorithm in CUDA
Cuda
Switch branches/tags
Nothing to show
Pull request Compare This branch is 1 commit ahead, 1 commit behind arendsee:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
README
data.txt
gibbs_metropolis.cu
smallData.txt

README

This program implements a MCMC algorithm for the following hierarchical
model:

y_k     ~ Poisson(n_k * theta_k)
theta_k ~ Gamma(a, b)
a       ~ Unif(0, a0)
b       ~ Unif(0, b0) 

I let a0 and b0 be arbitrarily large.

Arguments:
    1) input file name
        With two space delimited columns holding integer values for
        y and float values for n.
    2) number of trials (1000 by default)

Output: A comma delimited file containing a column for a, b, and each
theta. All output is written to standard out.

Example:

$ head -3 data.txt
 4 0.91643
 23 3.23709
 7 0.40103

$ a.out data.txt 2500 > output.csv

This code borrows from the nVidia developer zone documentation, 
specifically http://docs.nvidia.com/cuda/curand/index.html#topic_1_2_1