Now following from the slides, let’s try plotting residuals vs. covariates. We see almost no improvement, so might refit the second model here with k=8.Ĭheck to see if any of your models need this treatment. Doubling again dsm_k_check_eg <- dsm(count ~ s(Depth, k=16), The ?choose.k manual page can offer some guidance.Ĭontinuing with that example, if we double k: dsm_k_check_eg <- dsm(count ~ s(Depth, k=8), You can always switch back to the smaller k if there is little difference. Generally if the EDF is close to the value of k you supplied, it is worth doubling k and refitting to see what happens. Note here again I’m using a “chunk” option to suppress the plots printed by gam.check # indicate that k is too low, especially if edf is close to k'. # Hessian positive definite, eigenvalue range. # observations are outside of detection function truncation! gam.check(dsm_k_check_eg) Here’s a silly example where I’ve deliberately set k too small: dsm_k_check_eg <- dsm(count ~ s(Depth, k=4),įamily=tw()) # Warning in make.data(response, ddf.obj, segment.data, observation.data, : Some Looking at how changing k changes smoothsįirst checking that k is big enough, we should really do this during model fitting, but we’ve separated this up for the practical exercises.įirst look at the text output of gam.check, are the values of k' for your models close to the edf in the outputted table.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |