Additional downstream predictive nodes are also being sampled by posterior_predictive sampler

22 views
Skip to first unread message

Mwandida Afuleni

unread,
Dec 12, 2023, 1:10:14 PM12/12/23
to nimble-users
Dear All,

I am learning NIMBLE. I have a dependent variable (count data-number of cases named Cas in the code) and two predictors, one is a factor (named age_id ) and the other one is proportion (named Pov ). I would like to fit a GLM with NIMBLE. 

Below is how I have defined model code. Note that I have included e[i], which is the expected number of cases (named ExpCas in the code).

GPmodel<-nimbleCode({
  beta0 ~ dnorm(0,sd = 10000)
  beta1 ~ dnorm(0,sd = 10000)
  beta2 ~ dnorm(0,sd = 10000)
 
   for(i in 1:N){
    y[i] ~ dpois(mu[i])
    log(mu[i]) <- beta0 + beat1*x1[i] + beta2*x2[i] + e[i]
    theta[i]~dgamma(a,b)
    }
   a~dexp(0.1)
   b~dexp(0.1)
 
})

GPdata<-list(y=data1$cas)

GPconsts<-list(N=168,
               x1=data1$Pov,
               x2=data1$age_id,
               e=data1$ExpCas)
GPinits<-list(beta0=0, beta1=0, beta2=0, a=0.1 , b=0.1, theta=rep(c(1), times=GPconsts$N))




Now, the problem comes when configuring the model  i.e configureMCMC( )

I get the following note, which I believe affects the output, and I haven't found a way to correct that yet. 
           "  [Note] Additional downstream predictive nodes are also being sampled by    
             posterior_predictive sampler "
 
I also suspect I have incorrectly defined the model, but I can not trace the part. 


Your help will be greatly appreciated!

Regards,

Mwandida.


Daniel Turek

unread,
Dec 12, 2023, 1:21:05 PM12/12/23
to Mwandida Afuleni, nimble-users
It might just be the mis-spellinging of "beat1" in the line:

    log(mu[i]) <- beta0 + beat1*x1[i] + beta2*x2[i] + e[i]

Give that a try.

Daniel



--
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/fb026eae-2326-47ce-8460-4c3c25951467n%40googlegroups.com.

Mwandida Afuleni

unread,
Dec 13, 2023, 3:40:34 PM12/13/23
to Daniel Turek, nimble-users
Hi Daniel,

Thank you so much, I will correct that.

Regards,

Mwandida.
--
Best Regards,

Mwandie Kamba Afuleni

PhD Candidate - Mathematical Sciences (The University of Manchester, England, UK)

MSc. in Mathematical Sciences (The University of Ghana: AIMS-Ghana)


+265 999 129 502 / +265 888 890 367
Reply all
Reply to author
Forward
0 new messages