Poisson lognormal convergence

已查看 23 次
跳至第一个未读帖子

Isaque Pim

未读,
2022年12月1日 23:36:492022/12/1
收件人 nimble-users

Dear Nimble users,


I've been using Nimble to model case counts of the West African Ebola outbreak. I'm doing it in the same fashion people model the famous Scotland Lip Cancer dataset. Currently I'm having some trouble trying to make the model converge.


Actually, the basic Poisson lognormal model apparently  presents no MCMC problems. When I add an ORLE term, autocorrelation spikes and the model shows poor efficiency (some betas presenting 0.1 ESS/s).


Here’s a sample of the attached code:

#Simple model, no ORLE 

modelo1_simples <- nimbleCode({

  for (i in 1:N){

    y[i] ~ dpois(mu[i])

    log(mu[i]) <- log(e[i]) + b0 + inprod(X[i,1:p],beta[1:p])

  }

  b0 ~ dnorm(0,0.001)

  beta[1:p] ~ dmnorm(mean = m[1:p], cov = cov[1:p, 1:p])

})

# Model with ORLE

modelo2_ORLE <- nimbleCode({

  for (i in 1:N){

    y[i] ~ dpois(mu[i])

    log(mu[i]) <- log(e[i]) + b0 + inprod(X[i,1:p],beta[1:p]) + u[i]

    u[i] ~ dnorm(0, tau.b)

  }

  tau.b ~ dgamma(1,0.01)

  b0 ~ dnorm(0,0.001) 

  beta[1:p] ~ dmnorm(mean = m[1:p], cov = cov[1:p, 1:p])

})


And I’m running quite long chains: 300,000 iter; 200,000 burnin; thinning = 10.

As another example, take a look at the traceplot for the same beta for each model
86e9380e-959c-48c2-b506-8056a9d52cd6.png
75c47512-3a7b-44d1-9468-16dad458168e.png

Any suggestions on how to deal with the problem? Could it be model misspecification?

Code and data attached. 

Thanks,
Isaque

ebola.R
data.7z

Chris Paciorek

未读,
2022年12月2日 11:26:182022/12/2
收件人 Isaque Pim、nimble-users
I suspect the mean of the u's is trading off with b0. You might try a centered parameterization:

u[i] ~ dnorm(b0, tau)

Or you might devise a joint sampler for b0 and the u's jointly - we have an example on this in

Or you might try HMC using our new beta release of nimble and the associated nimbleHMC package.

-Chris

--
You received this message because you are subscribed to the Google Groups "nimble-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nimble-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nimble-users/ad6d5409-4d54-4017-ae14-d617c607dfe9n%40googlegroups.com.
回复全部
回复作者
转发
0 个新帖子