Introduction to Generalized Additive Models

การสร้างโมเดลแบบไม่เชิงเส้นด้วย Generalized Additive Models (GAMs) ใน R

Noam Ross

Senior Research Scientist, EcoHealth Alliance

การแลกเปลี่ยนในการสร้างโมเดล

$$

$$

การสร้างโมเดลแบบไม่เชิงเส้นด้วย Generalized Additive Models (GAMs) ใน R

ความสัมพันธ์แบบไม่เชิงเส้น

การสร้างโมเดลแบบไม่เชิงเส้นด้วย Generalized Additive Models (GAMs) ใน R

ความสัมพันธ์แบบไม่เชิงเส้น

linear_mod <- lm(y ~ x, data = my_data)

การสร้างโมเดลแบบไม่เชิงเส้นด้วย Generalized Additive Models (GAMs) ใน R

ความสัมพันธ์แบบไม่เชิงเส้น

library(mgcv)
gam_mod <- gam(y ~ s(x), data = my_data)

การสร้างโมเดลแบบไม่เชิงเส้นด้วย Generalized Additive Models (GAMs) ใน R

ฟังก์ชันพื้นฐาน

$$

การสร้างโมเดลแบบไม่เชิงเส้นด้วย Generalized Additive Models (GAMs) ใน R

ฟังก์ชันพื้นฐาน

gam_mod <- gam(y ~ s(x), data = my_data)

coef(gam_mod)
(Intercept)     s(x2).1     s(x2).2    
7.814448        5.272290    5.104941

s(x2).3         s(x2).4     s(x2).5
1.271135        1.720561   -1.180613 

s(x2).6 
-2.676133
การสร้างโมเดลแบบไม่เชิงเส้นด้วย Generalized Additive Models (GAMs) ใน R

มาฝึกกันเถอะ!

การสร้างโมเดลแบบไม่เชิงเส้นด้วย Generalized Additive Models (GAMs) ใน R

Preparing Video For Download...