问题
R, Bayestats and Jags newbie here. I'm working on modeling some count data, right censored. Poisson seems to be my best guess. I wanna do a hierarchical model, as it leaves me with more possibilities to fine tune the parameterss. Can I simply write something like this:
A[i,j] <- dpois(a[i,j])
a[i,j]) <- b[i,]*x[i,j] +c[i] for all j,
where x[i,j]
are my variables, or should I separate the censored time interval from the previous ones or something?
b[,]
and c
have a prior.
Thank you!
回答1:
This is not clear to me what is supposed to be hierarchical.
You can have the time effect separated from the covariate effect, in which case the covariate effect is not related to the station.
Moreover, the linear part of your GLM should be positive because poisson distribution requires positive values. Look here: http://www.petrkeil.com/?p=1709
A proposition for you could be:
b1 ~ prior
b2 ~ prior
c ~ prior
for (t in 1:n_time) {
b_time[t] ~ prior
for (i in 1:n_stations) {
A[i,t] <- dpois(a[i,t])
log(a[i,t]) <- b1*b_time[t]*X1[i,t] + b2*b_time[t]*X2[i,t]+ c[i]
}}
来源:https://stackoverflow.com/questions/44476162/jags-poisson-count-censored-data