Hello,
I wonder is there any methods to estimate the GOF and c-hat of Royle-Nichols model? I used to use the following code to estimate the GOF of single-season occupancy model and RN model:
chisq=function(fm){
umf=getData(fm)
y=getY(umf)
y[y>1]=1
fv=fitted(fm,na.rm=T)
y[
is.na(fv)]=NA
sum((y-fv)^2/(fv*(1-fv)),na.rm=T)
}
pb=parboot(object=fmoR, statistic=chisq, nsim=10)
But after read the comments of Marc in this thread "
Problems to assess the Goodness of fit in R&N models" (
https://groups.google.com/forum/?hl=zh-CN#!topic/unmarked/ICKiDUp_sZM), I learnt that this method was inappropriate and what I should compare was the probabilities of different 1-0 detection histories rather than the "y-fv".
Thus I use the mb.gof.test function of AICcmodavg to estimate the GOF and c-hat of single-season occupancy model, but I haven't found a function which can estimate the GOF and c-hat of RN model.
Therefore I wonder whether it is appropriate to use the MacKenzie and Bailey (2004) method to estimate the GOF and c-hat of RN model? I am thinking about calculating the psi and p of each site from its lamda and r first, then calculating the probability of each 1-0 combination, finally using a method similar to the mb.gof.test method to calculate the chi-square statistic.
But since I am a beginner of R, it means a great challenge. On the other side, my main purpose of calculating c-hat is to estimate the fit of my camera-trap data before analysis. Thus could I borrow the c-hat value calculated from ordinary occupancy analysis to estimate the data-fit roughly when I conduct the RN model analysis?
Look forward to all your opinions. Thank you very much!
Best wishes,
Sun, Ge