Closed gpandradep closed 3 years ago
Since the response variable for the occupancy process is binary (0/1), regular residuals aren't very informative. Thus plot_residuals
calculates binned residuals (see Gelman and Hill 2007 for more info). Binned residuals work by dividing up your datapoints into bins based on their fitted values, which in this case would be predicted occupancy for each datapoint/site. If you don't have any covariates in your occupancy model (as you don't), predicted occupancy will be the same for all sites. In that case it will be impossible to divide up the fitted values into logical bins since they all have identical values, and you get that error. Residuals are not likely to be a helpful diagnostic for the occupancy submodel in this case.
Best regards Ken, First I wanted to congratulate and thank you for your work on unmarked as well as this new package. I am working with basicoccupancy models for camera trap data. I have 67 sites with 27 sampling events, 110 detections, 1038 no-detections and 661 NAs. Everything works perfect when fitting the models with ubms and I have very similar results to unmarked. My best model was this
I have no problem generating the residuals plots for the detection parameter
plot_residuals(mg5_stan, submodel="det")
plot_residuals(mg5_stan, submodel="det", covariate="Slope")
But the problem comes when I want to make the residuals diagnostic plots for the occupancy parameter
I am new to Bayesian approach and the Wright et al 2019 definition of residuals. which doesn't give me much clue as to what might be generating this error. is it a bug or am I missing something?