Puzzling on probabilistic programming language in Julia, Turing.jl and Distributions.jl

214 Views Asked by At

I am currently working on a simple Bayesian problem in which my likelihood is the product of N Poisson distributions, so I got the following:

likelihood(x) ~ product_i(Poisson(mean_i))

where x is a vector, representing the variables, and the product on the other side run over the dimension (from i to N). mean_i is the mean associated to the variables x_i in the vector x.

As far as I have understood Turing and Distributions, I think that the following is the 'correct' code part for the likelihood:

vector_x = [x for x in variables]
vector_x ~ Product([Poisson(mean_i) for mean_i in means]

where means is a vector containing the various means associated to each poisson process. Is it correct? :D

0

There are 0 best solutions below