I am fitting a simple linear regression model with R & JAGS:
model {
for (i in 1:length(ri)){
ri[i] ~ dnorm(mu[i],tau)
mu[i] <- alpha + b.vr*vr[i] + b.ir*ir[i]
}
#posterior predictive distribution
for (j in 1:length(pvr)){
pmu[j] <- alpha + b.vr*pvr[j] + b.ir*pir[j]
pri[j] ~ dnorm(pmu[j],tau)
}
#priors for regression
alpha ~ dnorm(0,0.01)
b.vr ~ dunif(-10,0)
b.ir ~ dunif(0,10)
#prior for precision
tau ~ dgamma(0.001,0.001)
sigma <- 1/sqrt(tau)
}
I am trying to calculate the posterior predictive distribution with new data (pvr
and pir
in the model). But somehow the reported results (pri
) do not make sense (the means of pri
are smaller than expected).
Could someone explain me, is something wrong with the model specification?