**Appendix 2: occupancy model specifications, diagnostics, and fit test**

We fit the occupancy model with the program JAGS [117] called from the statistical software R [118] using the package jagsUI [119]. We used vague truncated normal priors for species coefficients and vague gamma priors for associated standard deviations [64]. Posterior distributions for coefficients were estimated with Markov chain Monte Carlo methods using four chains of 20,000 iterations each run in parallel after a 5,000-iteration burn-in phase (thinning = 10). We considered adequate convergence a potential scale reduction factor (*R*^) <1.05 [120] and "grassy" trace plots for all parameters [64]. We calculated the 90% highest density intervals using the R package HDInterval [121].

*A Hierarchical Approach to Fish Conservation in Semiarid Landscapes: A Need to Understand… DOI: http://dx.doi.org/10.5772/intechopen.105602*

We examined model fit using a posterior predictive check [64] based on the goodness-of-fit test described by [122]. We simulated expected species encounter histories under model parameters to compare discrepancies with observed encounter histories and calculated a Bayesian *p*-value (0.47). A Bayesian *p*-value near 0.5 suggests adequate fit and extreme values (i.e., <0.05 or >0.95) indicate a lack of fit [64, 123].
