From f5125fde7eada267cd5c23562a37edef62ca7a09 Mon Sep 17 00:00:00 2001 From: Sean Anderson Date: Mon, 25 Mar 2024 22:36:14 -0700 Subject: [PATCH] Remove 'mvn' examples from residuals vignette --- vignettes/web_only/residual-checking.Rmd | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/vignettes/web_only/residual-checking.Rmd b/vignettes/web_only/residual-checking.Rmd index 4a150b9f1..fc230e324 100644 --- a/vignettes/web_only/residual-checking.Rmd +++ b/vignettes/web_only/residual-checking.Rmd @@ -193,13 +193,6 @@ fit_nb2_miss$model$objective AIC(fit_nb2_miss, fit_nb2) # AIC supports including the 'a1' predictor ``` -The above used simulations with the parameters fixed at their Maximum Likelihood Estimate (MLE) and predictions conditional on the fitted random effects. Alternatively, we could simulate with the parameters drawn from their joint precision matrix to encapsulate uncertainty about the parameters. This may be a better test for residual analysis, but this is an open area of research as far as I can tell. - -```{r} -# simulate with the parameters drawn from the joint precision matrix: -s2 <- simulate(fit_nb2, nsim = 1, params = "MVN") -``` - Or we could simulate with new random fields based on the estimated parameters governing the random fields (range and SD): ```{r} @@ -207,22 +200,6 @@ Or we could simulate with new random fields based on the estimated parameters go s3 <- simulate(fit_nb2, nsim = 1, re_form = ~ 0) ``` -We could, of course, combine those two options: - -```{r} -# simulate with new random fields and new parameter draws: -s4 <- simulate(fit_nb2, nsim = 500, params = "MVN", re_form = ~ 0) -pred_fixed <- fit_nb2$family$linkinv(predict(fit_nb2)$est_non_rf) -r_nb2 <- DHARMa::createDHARMa( - simulatedResponse = s4, - observedResponse = dat$observed, - fittedPredictedResponse = pred_fixed -) -plot(r_nb2) -``` - -These also look OK. - For help interpreting the DHARMa residual plots, see `vignette("DHARMa", package="DHARMa")`. # References