Skip to content

Instantly share code, notes, and snippets.

View QuocTran's full-sized avatar

Quoc QuocTran

  • WalmartLabs
  • San Carlos, WI, USA
View GitHub Profile
@QuocTran
QuocTran / SimpleGibbs.jl
Created May 10, 2012 22:40 — forked from dmbates/SimpleGibbs.md
Simple Gibbs sampler in Julia
## A Julia version of Darren Wilkinson's R code
function JGibbs1(N::Int, thin::Int)
mat = Array(Float64, (N, 2))
x = 0.
y = 0.
for i = 1:N
for j = 1:thin
x = randg(3)/(y*y + 4)
y = 1/(x + 1) + randn(1)[1]/sqrt(2(x + 1))
end