Key question: should I use log(y) ~ … OR y ~ exp(…) OR y ~ … with lognormal family…or something else…
I’ve inherited a model that looks like this:
m1 <- brm(
bf(y / off_set ~ exp(b0 + b1 * f1 + b2 * f2),
b0 ~ 1,
b1 ~ 1,
b2 ~ 1,
nl=TRUE),
prior = c(
prior(normal(0, 5), nlpar = "b0"),
prior(normal(0, 5), nlpar = "b1"),
prior(normal(0, 5), nlpar = "b2")
),
data = df,
family = gaussian()
)
It gives reasonable predictions, but, given y > 0, off_set > 0, the ppc_check doesn’t look ideal to me:
I"d thought a better and simpler way to specify the model would be
m2 <- brm(log(y / off_set) ~ f1 + f2,
data = df)
Which gives a nice looking ppc_check plot:
But on a crude measure of fit, the first seems to perform better - that is, comparing y to exp(pred) * off_set vs. pred * offset for the first model…
Any help / guidance much appreciated!