Skip to main content
2 of 6
added 277 characters in body

I have gone through your posted code and have a couple of comments/ideas here:

  1. The boundary object that you're supplying does not have the variable f in each boundary list. This variable tells the model what to do right at the boundary. You will want to set f to 0 considering you want to model occurrence in the lake. Please the vignette/blog post on when in the code and how to create f.
  2. I have created the following GitHub repo with my edits to the code. I still cannot get {gratia} to draw the model, as it produces the same error, but you should be able to predict densities across the lake by following the blog/the GitHub repo uses the same methodology
  3. To check fixed and random effects and smoothers. I suggest looking at the main effects of the model first prior to running summary(). This can be done using anova.gam() or anova(). You will notice for the soap-film model that origin is not statistically significant which for the thin-plate model it is.
  4. I did not change this in my code but I do agree with @robert-lennox that your k value is likely to high resulting in the model overfitting.
  5. study_year is currently as smoother, do you want this or do you want this as a random effect. This could be why gratia is having a hard time with drawing it as you'll notice at the end of my script I use facet_grid() to plot origin and study_year.
  6. List item