Poisson log-normal model in rstanarm

327 views
Skip to first unread message

malai...@gmail.com

unread,
Nov 13, 2016, 8:25:21 PM11/13/16
to Stan users mailing list
Hi All,

I have currently fitted a negative binomial model in rstanarm, but i would like to fit the same data using poisson-lognormal model. Is there a way I can achieve that in rstanarm?

Thanks.

Ben Goodrich

unread,
Nov 13, 2016, 10:57:09 PM11/13/16
to Stan users mailing list
On Sunday, November 13, 2016 at 8:25:21 PM UTC-5, malai...@gmail.com wrote:
I have currently fitted a negative binomial model in rstanarm, but i would like to fit the same data using poisson-lognormal model. Is there a way I can achieve that in rstanarm?

No, but what is a Poisson-lognormal model?

Bob Carpenter

unread,
Nov 13, 2016, 11:21:33 PM11/13/16
to stan-...@googlegroups.com
Presumably,

lambda[n] ~ lognormal(mu, sigma);

y[n] ~ poisson(lambda[n]);

- Bob
> --
> You received this message because you are subscribed to the Google Groups "Stan users mailing list" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to stan-users+...@googlegroups.com.
> To post to this group, send email to stan-...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

malai...@gmail.com

unread,
Nov 14, 2016, 8:25:54 AM11/14/16
to Stan users mailing list
following is the description of the two models; negative binomial (poisson-gamma) and poisson-lognormal model.

 y_(i,t)  ~ Poisson(ε_i λ_(i,t)) 

Where:

y_(i,t) =    Observed number of crashes at site i in year t

λ_(i,t) =    Expected number of crashes at intersection I in year t

ε_i =    Multiplicative random effect at site i

The main difference between the Poisson-Lognormal and Poisson-Gamma model in estimating the expected crashes is on estimating the multiplicative random effect for site i. the following equations describe the estimation of ε_i for the two models.

For the Poisson-Lognormal model, ε_i  ~ LogN(0,σ^2)

For the Poisson-Gamma model, ε_i  ~ Gamma(φ,(1/φ)


 

Ben Goodrich

unread,
Nov 14, 2016, 9:03:28 AM11/14/16
to Stan users mailing list

In that case, I guess you can do a Poisson-lognormal model with

stan_glmer(y ~ ... + (1 | site), data = dataset, family = poisson(link = "log"), QR = TRUE)

Ben

malai...@gmail.com

unread,
Nov 21, 2016, 12:00:26 PM11/21/16
to Stan users mailing list
Hi Ben,

Thank you for the response. I followed the option you proposed and its working fine. I am just wondering what is the site variable?


On Sunday, November 13, 2016 at 8:25:21 PM UTC-5, malai...@gmail.com wrote:

Ben Goodrich

unread,
Nov 21, 2016, 2:29:23 PM11/21/16
to Stan users mailing list
On Monday, November 21, 2016 at 12:00:26 PM UTC-5, malai...@gmail.com wrote:
Thank you for the response. I followed the option you proposed and its working fine. I am just wondering what is the site variable?

I don't know,, but you said
Reply all
Reply to author
Forward
0 new messages