Skip to content

Commit

Permalink
Merge pull request #39 from xukai92/kx/improve-poisson
Browse files Browse the repository at this point in the history
Use mv normal instead of iid normals in Poisson
  • Loading branch information
itsdfish authored Aug 16, 2019
2 parents 73e6c6c + 9e31090 commit 21a6490
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions Models/Hierarchical_Poisson/Hierarhical_Poisson_Models.jl
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
@model AHMCpoisson(y,x,idx,N,Ns,::Type{T}=Vector{Float64}) where {T} = begin
@model AHMCpoisson(y,x,idx,N,Ns) = begin
a0 ~ Normal(0, 10)
a1 ~ Normal(0, 1)
a0_sig ~ Truncated(Cauchy(0, 1), 0, Inf)
a0s = T(undef,Ns)
a0s ~ [Normal(0, a0_sig)]
a0s ~ MvNormal(zeros(Ns), a0_sig)
for i 1:N
λ = exp(a0 + a0s[idx[i]] + a1*x[i])
λ = exp(a0 + a0s[idx[i]] + a1 * x[i])
y[i] ~ Poisson(λ)
end
end
Expand Down

0 comments on commit 21a6490

Please sign in to comment.