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),
                                 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!

Related Questions

How to interpret the negative variances

1  Asked on December 12, 2020 by aakash-bashyal


How big should my subsample be?

1  Asked on December 11, 2020 by kaecvtionr


How do you compare standard deviations?

2  Asked on December 10, 2020 by yaynikkiprograms


Can k-fold CV help reduce sampling bias?

0  Asked on December 9, 2020 by aite97


Ask a Question

Get help from others!

© 2022 All rights reserved. Sites we Love: PCI Database, MenuIva, UKBizDB, Menu Kuliner, Sharing RPP, SolveDir