What are splines in GLM?
Splines have a linear representation using derived covariates. As an example, a quadratic trend is non-linear, but can be modeled in a linear model by taking: E[Y|X]=β0+β1X+β2X2, thus X and its square are input into a linear model.
What is a GAM smoother?
From Wikipedia, the free encyclopedia. In statistics, a generalized additive model (GAM) is a generalized linear model in which the linear response variable depends linearly on unknown smooth functions of some predictor variables, and interest focuses on inference about these smooth functions.
Can a non linear spline be used in a GAM model?
But the splines trick is still handy. For instance, you can quickly modify an existing linear model to have a non-linear spline. Or use it in a Bayesian linear model that doesn’t have a GAM equivalent ( you can also spit out model matrices from mgcv and use them in Bayesian models if you want other types of splines).
Which is better for GLm 3 or 2 splines?
Yep, the 3 spline model has a much lower AIC despite using more model D.F., so is better. A nice feature of this cubic spline trick is that you can use it anywhere that takes a model matrix as input. So it will work with and any Bayesian GLM method you care to use.
Can a GAM be used as a GLM?
That’s not to say that GAM’s are just a special case of GLM’s though! While there are a series of models that exactly identical and can be framed as both a GAM or as a GLM with a spline expansion of the covariates, there are some GAM models that are not available in the standard GLM framework.
Where can I find splines and GAMS in R?
This lab on Splines and GAMs in R comes from p. 293-297 of “Introduction to Statistical Learning with Applications in R” by Gareth James, Daniela Witten, Trevor Hastie and Robert Tibshirani. It was re-implemented in Fall 2016 in tidyverse format by Amelia McNamara and R. Jordan Crouser at Smith College.