Hi All,
I am fitting a multi-species occupancy model for different amphibian
species. Some of the species are assumed to be detected without
false positives; however, two of the salamander species can be
confused with each other in the field when in the larvae life stage.
For those two species, I am fitting the false-positive multiple
detection state occupancy model of Miller et al . (2011) -
http://onlinelibrary.wiley.com/doi/10.1890/10-1396.1/abstract -,
where the larvae detections (when no other life stage is detected)
are the "uncertain" detections. I would like to use WAIC for model
selection. I have seen this post
(
https://sourceforge.net/p/mcmc-jags/examples/ci/ef7330d75872d8ae4e44acc7bf2d889fcfce1d9d/tree/classic-bugs/vol1/blocker/blocker.bug)
using the "logdensity.bin" command to calculate the log likelihood
when using the "dbin" command in jags. This seems to work for most
of the species by simply using this bit of code -
"log.lik.LICA[tt,ii,jj]<-
logdensity.bin(detect.LICA[tt,ii,jj],p.LICA[tt,ii,jj],z.LICA[tt+1,ii])".
Is there an option like "
logdensity.cat" when using the "dcat"
command like I need to use to fit the false-positive occupancy
model? I have tried "log.lik.AMMA[tt,ii,jj]<-
logdensity.cat(detect.AMMA[tt,ii,jj],pi.AMMA[tt,ii,jj,],z.AMMA[tt+1,ii])".
It returns the error "
Incorrect number of parameters in
function logdensity.cat". To me this means the command does
exist for jags but that it has a different number of inputs than
what I am using. I have searched around and cannot find an example
of this. Has anyone come across this that can steer me in the right
direction? Thank you in advance for your help.
Cheers,
Adam