TransWikia.com

Specifying several independent priors in stan_glm() in R

Cross Validated Asked by MarG on August 23, 2020

I am using the function stan_glm() in R. I am using 4 predictor variables and I want to specify a univariate independent prior for each regression parameter. Right now I am trying to include each prior by placing them in a list through the following code snippet:

  poisson.model.stan <- stan_glm(Count ~ v1 + v2 + v3 + v4, 
                                 family = poisson(link=log),
                                  data=data,
                                 chains = 4, cores = 5, seed = 55, iter = 100000,
                                 offset=log(exposure), prior_intercept = normal(-2,1), 
                                 prior = c(normal(-0.2, 0.05),
                                           normal(0.1, 0.05),
                                           normal(0.3, 0.05),
                                           normal(0.04, 0.05)))

However, I am not sure whether this is the correct way of specifying my priors.
To summarize, how do I specify several independent priors in the stan_glm() function?

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP