BaşlayınÜcretsiz Başlayın

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.

Bu egzersiz

Nonlinear Modeling with Generalized Additive Models (GAMs) in R

kursunun bir parçasıdır
Kursu Görüntüle

Egzersiz talimatları

  • Fit a GAM models to the mcycle data with accel as a smooth function of times with 50 basis functions and a smoothing parameter of 0.0001.
  • Visualize the model.

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

library(mgcv)

# Fit the GAM
gam_mod_sk <- ___

#Visualize the model
plot(gam_mod_sk, residuals = TRUE, pch = 1)
Kodu Düzenle ve Çalıştır