GLM "zero-effect" priors


I am trying to use a GLM-like model to infer intercepts and slopes associated to certain experimental conditions. I am using the pystan interface and writing down the design matrix that multiplies these coefficients (so not using stan_glm or anything like that) – besides some details for all purposes here this can be treated like a regular GLM with log link.

My issue is: for all bur the grand mean I want to specify priors that have a (possibly normal) distribution with greatest probability of having no effect. For a linear model that could be something like:

model {
  beta1 ~ normal(0,1);
  beta2 ~ normal(0,1);

  vector[N] mu = beta0 + beta1 +beta2*x;

  y ~ normal(mu, sigma); 

that would make the probability of effects 1 and 2 be most likely zero in the absence of information from the likelihood, but GLM it is not the same:

model {
  beta1 ~ normal(0,1);
  beta2 ~ normal(0,1);

  vector[N] log_mu = beta0 + beta1 +beta2*x;

  y ~ poisson(exp(log_mu)); 

is it possible to specify a prior that when exponentiated will result in a zero effect. I am assuming there can’t be a prior beta1 ~ normal(-Infinity,1). Would a lognormal be the “canonical” prior for this link function, or is it actually the other way around? Never used link functions before. Thanks.


I might be misinterpreting the question but I think you can just keep the normal(0,1) priors.

log(\mu)= \beta_ 1 + \beta_2 x \implies \mu = exp(\beta_1) exp(\beta_2 x)

So for \beta_2 = 0, \mu does not change with x.

You can make the specification more robust by using the specialised stan function.

vector[N] mu = beta0 + beta1 + beta2*x;
y ~ poisson_log(mu);


I think you’re completely right and it was probably a stupid question to start with: the coefficients in the linear predictor works the same as a linear model and is exponentiated afterwards, otherwise being a product.
It is maybe less clear when written as a design matrix, but it should be the same there too. Thanks.