JAGS Poisson count censored data

偶尔善良 提交于 2019-12-24 13:32:36

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!