Hi Nimble Community,
I am struggling with calculating WAIC for a integrated model. The model has a multi-state component, where I am using marginal likelihood to avoid estimating the true latent states (z). The likelihood component for this portion is
for(i in 1:marked){
y[i,f[i]:l[i]] ~ dHMM(probInit = TLM[spz[i],fs[i],1:15],
probObs = OPM[R[i],1:15,1:17],
probTrans = TPM[spz[i],f[i]:(l[i]-1),1:15,1:15],
len=length(f[i]:l[i]))
}
where y is the observed state of fish i. I believe since I am using marginal likelihood, and since dHMM returns onee likelihood value for each fish's capture history I should use marginal WAIC for node y, and groups y[i,f[i]:l[i]]. Is this correct? My waic control arguments are
for(i in 1:constants$marked){groups[i]<-paste0('y[',i,',',constants$f[i],':',constants$l[i],']')}
list(dataGroups=groups,MarginalizeNodes='y').
The second portion of the model is a multinomial glm. The likelihood is as follows
for(i in 1:lrow){
marr[i,1:175]~dmulti(pi[i,1:175],n[i])
}
should I group nodes marr[i,1:175] as well since one likelihood value is calculated for each row in marr?
Thanks for all the help. I am very new to WAIC.
Best,
Max