I am building a generalized linear model using the logit function in R using JAGS. Whenever I saw code people only define priors for the parameters of the model, but never for parameters of the distribution of the data. Why is that the case?
Take as an example the code below. Priors for beta0 and beta1 are defined, but not for p[i] (like they would if you would simply look for the posterior of p given the data).
dat.list <- with(dat, list(y=y, x=x, N=nrow(dat)))
modelString="
model{
for (i in 1:N) {
y[i] ~ dbern(p[i])
logit(p[i]) <- beta0+beta1*x[i]
}
beta0 ~ dnorm(0,1.0E-06)
beta1 ~ dnorm(0,1.0E-06)
}
"
p[i]
is clearly defined via thelogit(p[i])
line combined with the definitions ofbeta0
andbeta1
as Normally distributed with means 0 and precisions 1e-6. $\endgroup$