gam
in the smoothing.
s(x, df=4, spar=0)
spar
below) is found such that
df=tr(S)-1
, where
S
is the implicit smoother matrix. Values for
df
should be greater than
1
, with
1
implying a linear fit.
0
.
x
is returned, endowed with a number of attributes.
The vector itself is used in the construction of the model matrix,
while the attributes are needed for the backfitting algorithms
all.wam
or
s.wam
(weighted additive model).
Since smoothing splines reproduces linear fits,
the linear part will be efficiently computed with the
other parametric linear parts of the model.
Note that
s
itself does no smoothing; it simply sets things up for
gam
.
# fit Start using a smoothing spline with 4 df. y ~ Age + s(Start, 4) # fit log(Start) using a smoothing spline with 5 df. y ~ Age + s(log(Start), df=5)