gam(v ~ s(x))
You are missing out!
2/n
3/n
gives a 'smoothing basis' with a cubic spline with shrinkage.
Shrinkage means they will 'shrink' to a flat line if the term isn't important.
So you get model selection 'for free' (no AIC!)
4/n
5/n
Gives you a random effect with groups, similar to lme4 or nlme, without having to use those packages.
Then do gam.vcomp(m1) to get the rand effect variances
6/n
(image from mfasiolo.github.io/mgcViz/referen…)
7/n
MRF is for dependence between neighbouring regions, gp for coordinates (e.g. x,y)
8/n
Then use
predict.gam(m1, type = "lpmatrix)
see ?predict.gam for an example
9/n
GAM smoothers have a penalty. And what is a penalty if not a Bayesian prior?)
10/n
11/n
13/n
14/n
s(x, by = groups)
fits one smoother per group, if groups is a factor.
s(x, by = groups, id = "A")
does the same, but will use the same (not variable) smoothing factors for each group
15/n
if you do
s(x, by = y)
and y is numeric, it fits a smoother where the effect of x varies with y, e.g. you can do 'geographic regression', where an effect varies across space
16/n