36-402, Section A, Spring 2019
19 February 2019
\[ \newcommand{\TrueRegFunc}{\mu} \newcommand{\EstRegFunc}{\widehat{\mu}} \newcommand{\Expect}[1]{\mathbb{E}\left[ #1 \right]} \newcommand{\Var}[1]{\mathbb{V}\left[ #1 \right]} \DeclareMathOperator*{\argmin}{argmin} % thanks, wikipedia! \]
Yes, if bias and variance both \(\rightarrow 0\), then the estimate must converge on the truth
mgcv
gam
and newer, nicer mgcv
gam
(Generalized Additive Model)
lm
but can tell it to smooth variables:s()
s()
as “smooth”, but it really means “spline”gam()
knows about lots of other smoother techniques
te()
, ti()
, etc., etc., etc.mgcv::gam
predict
: Works just like with lm
(or npreg
for that matter), see help(predict.gam)
for detailsfitted
, residuals
: Work just like with lm
plot
: We just saw this; many options, some described in text, see help(plot.gam)
for detailscoefficients
: Mostly coefficients of the spline polynomials — NOT INTERPRETABLEgam(y ~ x1+s(x2))
gam(y ~ s(x1, x2))
gam
rather than lm