21.04.2014 Views

1h6QSyH

1h6QSyH

1h6QSyH

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

7.7 Generalized Additive Models 283<br />

Local Linear Regression<br />

Wage<br />

0 50 100 200 300<br />

Span is 0.2 (16.4 Degrees of Freedom)<br />

Span is 0.7 (5.3 Degrees of Freedom)<br />

20 30 40 50 60 70 80<br />

Age<br />

FIGURE 7.10. Local linear fits to the Wage data. The span specifies the fraction<br />

of the data used to compute the fit at each target point.<br />

7.7.1 GAMs for Regression Problems<br />

A natural way to extend the multiple linear regression model<br />

y i = β 0 + β 1 x i1 + β 2 x i2 + ···+ β p x ip + ɛ i<br />

in order to allow for non-linear relationships between each feature and the<br />

response is to replace each linear component β j x ij with a (smooth) nonlinear<br />

function f j (x ij ). We would then write the model as<br />

y i = β 0 +<br />

p∑<br />

f j (x ij )+ɛ i<br />

j=1<br />

= β 0 + f 1 (x i1 )+f 2 (x i2 )+···+ f p (x ip )+ɛ i . (7.15)<br />

This is an example of a GAM. It is called an additive model because we<br />

calculate a separate f j for each X j , and then add together all of their<br />

contributions.<br />

In Sections 7.1–7.6, we discuss many methods for fitting functions to a<br />

single variable. The beauty of GAMs is that we can use these methods<br />

as building blocks for fitting an additive model. In fact, for most of the<br />

methods that we have seen so far in this chapter, this can be done fairly<br />

trivially. Take, for example, natural splines, and consider the task of fitting<br />

the model<br />

wage = β 0 + f 1 (year)+f 2 (age)+f 3 (education)+ɛ (7.16)

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!