
These types of residuals are known to have statistical issues for state-space models even if the model is the ‘correct’ model, the QQ plot may appear to have problems (Thygesen et al. 2017). We can see here that there are likely issues with the Poisson model in the tails. They apply randomization to integer response values, transform the residuals using the distribution function (e.g., pnorm()), simulate from a uniform distribution, and transform the samples such that they would be Gaussian if consistent with the model. They are also known as PIT (probability-integral-transform) residuals. These use the approach from Dunn and Smyth (1996). Rq_res <- residuals ( fit_nb2 ) qqnorm ( rq_res ) qqline ( rq_res ) Here are randomized quantile residuals at fixed effect MLEs (Maximum Likelihood Estimates) and random effects that maximize the log likelihood at estimated fixed effects: The model missing the ‘a1’ predictor does so to a lesser degree. We can see just by looking at these fits that the Poisson model inflates the spatial random field standard deviation (SD) compared to the truth. fit_nb2_miss Spatial model fit by ML #> Formula: observed ~ 1 #> Mesh: mesh #> Data: dat #> Family: nbinom2(link = 'log') #> #> coef.est #> (Intercept) 0.63 0.15 #> #> Dispersion parameter: 0.19 #> Matern range: 0.15 #> Spatial SD: 0.75 #> ML criterion at convergence: 1572.703 #> #> See ?tidy.sdmTMB to extract these values as a data frame.

fit_nb2 Spatial model fit by ML #> Formula: observed ~ 1 + a1 #> Mesh: mesh #> Data: dat #> Family: nbinom2(link = 'log') #> #> coef.est #> (Intercept) 0.52 0.14 #> a1 0.59 0.08 #> #> Dispersion parameter: 0.21 #> Matern range: 0.20 #> Spatial SD: 0.51 #> ML criterion at convergence: 1542.780 #> #> See ?tidy.sdmTMB to extract these values as a data frame.
#RESIDUAL CHECK PC#
Pc Spatial model fit by ML #> Formula: observed ~ 1 + a1 #> Mesh: mesh #> Data: dat #> Family: poisson(link = 'log') #> #> coef.est #> (Intercept) -0.17 0.34 #> a1 0.65 0.02 #> #> Matern range: 0.13 #> Spatial SD: 2.40 #> ML criterion at convergence: 3187.274 #> #> See ?tidy.sdmTMB to extract these values as a data frame.
