When using the lognormal() family in brms the link specification is not behaving as expected. When I specify "link_sigma = ‘identity’ " versus "link_sigma = ‘log’ " I do not see a change for “Links:” when I use summary on the model. At first I thought that this was maybe just because the text wasn’t being updated in the summary, but then I checked the underlying stan code on a simple model and I do not see it change as expected (I thought it would change the likelihood in the model block).
Here is a MWE:
dat <- data.frame(y=rpois(100, 10), x = rnorm(100, 50, 10))
m1 <- brm(y~x, family=lognormal(link = "identity", link_sigma = "identity"), data = dat)
m2 <- brm(y~x, family=lognormal(link = "identity", link_sigma = "log"), data = dat)
# summary doesn't reflect link difference
summary(m1)
summary(m2)
# expected difference doesn't show up
stancode(m1)
stancode(m2)
One possibility is that I am misunderstanding how a link function operates on the sigma term. Could someone please clarify what the model notation should be for m1 and m2 above with a log link for sigma? With some default priors I would have thought:
m1:
y_i ~ logNormal(u, sigma)
u_i = intercept + B_1*x_i
B_1 ~ Norm(0, 10)
sigma ~ StudentT(3, 0, 10)
m2:
y_i ~ logNormal(u, sigma)
u_i = intercept + B_1*x_i
B_1 ~ Norm(0, 10)
log(sigma) ~ StudentT(3, 0, 10)
Thank you in advance!
- Operating System: MacOS 10.13.6
- brms Version: 2.10.0