Complexity and smoothing together
The number of basis functions and the smoothing parameters interact to control the wiggliness of a smooth function. Here you will see how changing both together affects model behavior.
Diese Übung ist Teil des Kurses
Nonlinear Modeling with Generalized Additive Models (GAMs) in R
Anleitung zur Übung
- Fit a GAM models to the
mcycledata withaccelas a smooth function oftimeswith 50 basis functions and a smoothing parameter of 0.0001. - Visualize the model.
Interaktive Übung
Vervollständige den Beispielcode, um diese Übung erfolgreich abzuschließen.
library(mgcv)
# Fit the GAM
gam_mod_sk <- ___
#Visualize the model
plot(gam_mod_sk, residuals = TRUE, pch = 1)