• No results found

Moving Beyond Linearity

N/A
N/A
Protected

Academic year: 2022

Share "Moving Beyond Linearity"

Copied!
32
0
0

Bezig met laden.... (Bekijk nu de volledige tekst)

Hele tekst

(1)

Moving Beyond Linearity

David J. Hessen

Utrecht University

March 7, 2019

(2)

Statistical learning

Supervised learning I a single response y

I multiple predictors x 1 , . . . , x p

Multiple regression (interval response): y = f (x 1 , . . . , x p ) + ε Binary logistic regression: π = exp {f(x 1 , . . . , x p ) }

1 + exp {f(x 1 , . . . , x p ) }

The assumption of linearity: f (x 1 , . . . , x p ) = β 0 + β 1 x 1 + . . . + β p x p

(3)

Statistical learning

Why this inflexible (very restrictive) approach?

I If linearity is true, then there is no bias and no more flexible method competes → the variance of the estimator of f(x 1 , . . . , x p ) will be smaller

I Often the linearity assumption is good enough

I Very interpretable

(4)

Statistical learning

What can be done when linearity is not good enough?

1. Polynomial regression 2. Piecewise polynomials 3. Regression splines 4. Smoothing splines 5. Local regression

6. Generalized additive models

Modeling approaches 1 to 5 are presented for the relationship between

response y and a single predictor x

(5)

Polynomial regression

linear function : f (x) = β 0 + β 1 x

quadratic function : f (x) = β 0 + β 1 x + β 2 x 2

cubic function : f (x) = β 0 + β 1 x + β 2 x 2 + β 3 x 3

.. . .. .

degree-d polynomial: f (x) = β 0 + β 1 x + β 2 x 2 + . . . + β d x d

It’s just the standard linear model

f (x 1 , . . . , x d ) = β 0 + β 1 x 1 + β 2 x 2 + . . . + β d x d where

x 1 = x, x 2 = x 2 , . . . , x d = x d

(6)

Polynomial regression

I The coefficients β 0 , β 1 , . . . , β d can be easily estimated using least squares

I The interest is more in the fitted value

f (x) = ˆ ˆ β 0 + ˆ β 1 x + ˆ β 2 x 2 + . . . + ˆ β d x d than in the coefficient estimates ˆ β 0 , ˆ β 1 , . . . , ˆ β d

I Usually, either d is fixed to 3 or 4, or cross-validation is used to choose d

I Especially near the boundary of x the polynomial curve can

become overly flexible (bad for extrapolation)

(7)

Polynomial regression

20 30 40 50 60 70 80

50100150200250300

Age

Wage

Degree−4 Polynomial

20 30 40 50 60 70 80

0.000.050.100.150.20

Age

| | | | ||| |||||||||| ||||||| |

|

|

| |

| || || || | | | | ||| || |

|

|

| | | |

|

| |

| | | | ||| | | || || |

| | || | | |

|

||| | || ||||| ||| || |

| | ||||| |||||||| ||| || || | |

|

|

| |

| ||

| | || | || | ||

||| |||||||||||||||||||||||| |||||||| ||||||||||||||||||||||| | ||||| |||||| |

|

|

|

| ||| |||||| | | || |

| | | | | || || |

| |

|

| | |

|

|

| |

|

| |||||| ||| |||| ||||||||||||||||| ||| |

| ||||| || | || ||| |||| || |

||||||||| | |||||||| ||||| |||| || ||||| |||||||| || | |

|

| | | |

| || || ||| | | ||

| | | | |

|

|

| |

|

| |

| |

| | | | |

| |

||||||| ||||||||||||||||||||||||| ||||||||||| ||||| |

| | | || || |

|

|||| || ||||||

|

|| | |

| ||| || |||||||||||||| |||| || |||

|

| ||| | ||| | | || |

|

|

| ||| | | |

| | |

|

|

|

|| | | |||| | ||

| | | || |

|

|

|

| |

| | |

| | |

| | | ||| || | |

| || || | |

|

| | |

|||| | | |

|

|| | | |

|

|

| ||| || | ||| | |

| | | | |

||| ||||| || ||| |||||||||||| ||| |||| | |||| ||||| |

|

| |

|

| | |

| | | | | | | |

|

| | | | |

| |||

| | | ||| | |

| |||| | | ||||||||||| | ||

| | |

| | |

|

|

| ||

|

|

||| | || ||| | |||||| || |||

|

| |

| |

| || || || | ||| | | ||

| | | | || || | |

|

| |

| | | | |

| | | | | | |

||| | | || |||| ||||||

|

|

|

| |

| || |

| | | |

| ||| || || | || | |

| |

| |||| || | | |

|

|

||| | | |

|

| ||| ||||||| ||||||||| || |||||||| |||||||||||||||||||| ||||||| ||| | |

|

| |

| ||||| || | | |

|

|

| | | | |

||| | | || |||| || | |

| | |

|| | | || | || ||| | ||

|

|

| | | | ||

| | | || | |

||| |||||||| ||||||| ||| ||||||||||||||||||||||| |

|

|

| |

|

| | ||| || |||| | ||||| || |

| |||||||||| |||||||||||| ||| || |||||||||||| ||| |

|

| |

| || | |

| | | ||

| | | ||||| ||| | || |

|

| |||| | || |||| | |

|

| |

||||||||||||||||| |||| |||||||| | |

| ||| || | || | |

| | | ||| | | || | | | |

| || |||||||| | ||||| || | |

| ||| || ||| |||||||| | ||||

|

|

|

| ||

| | | | | | || | ||

| | |

||| || | ||| || |||||| || | | |

|

| |

|| | ||

| |

| |

| | |

| | |

| || |

|

| |

|

|

| ||

| | | | |

| | |

|

| |

|

| | | | |

|

| | || | |

|

| |

|| ||| |||||||||| || || |

| ||| | |||| ||||||| || | |

| ||

|

|| |||||||||| || |

| || | |

|

| | || | | ||

|||||||||||||||||||||||||||||||||||||||||||||||||||||| || |||||||||||||||| |||| ||||||

|

| |

|| |

|

|

| |

| ||| || |||||||| |

|||||| |||| ||||||||||||||||||||| |||||||||||||||||||||||| ||||||| ||||||||||| || |

|

| | | |

| |||| | | | | |

|||| | || | || |||| |||| | |

| | ||| | | |

| | |

| | | | |

|

|

||||| ||||||| |||||||||| |||||||||| |

|| | || | || |

| | || | | |

|

|

|| | | || |

| || ||||| ||||||||| |||||||| |||||

| | | |||||||||||| |||||||||| |||

|

|

| | || |

| | | |

| | |

|||||||| ||| || ||||||||||||| ||||||||||||||||| ||||||||||||||| || |

|

|

| | |

|

|

|

| | || || | |

|| ||| | || || | |

| |||| || | | |||| | |||||

| || | | | |

|

|

|

|

|| | | | | | |

| | || |

| | ||||| | || || || |

|| | |||| |

| | | | ||| |||

| | |

||||||||||||||||||||||| ||||||||||||||||| |||||||| |

|

| |

| | |||| ||||| | ||||| ||||||| | ||||| | |

|

| || | | |

|

|

| ||||| | || |

| | | | | ||

|||| | ||||||||||||||||||||||||||||||||||||||| |

| | | | |

| | || | |||| | ||| | |

|

|

|

|

| |

|

|

|| | ||

| | | | | |

|| |||| || | | ||| ||||||

|

|

| | |

| | |

| | | |

| | | | |||| |||| | || |

|||||||||||||||||||||||||||| ||||||||||||| ||| ||||||||| ||||||||||||

| | ||| ||||| |||||||||| | ||

|

| |

| | | | |

|

| | |

| || ||| | |

| |

|

| | | |

| |

| |

|| | | || || ||||||| | |

| | | | |||| || || | | |

| | |||| ||| || |||| ||| || || | |

|

|

| | | ||

|

| | | || | || |

|

|

| || | | | |

| | ||

|

|| |

|

|

| ||| | | |

| |

|

| || ||| |

|

|||||||| |||||||||||||||||||||||||||||||||||||||||||||||||||||| | | ||

|

| | | |

|

|

|

||| ||||||||||||||||||||||||||||||||||||| || | |

|

|

| |

|

| | |

| |

|

| |

| || | | | || |

|| | | ||| ||||||||||| | ||| ||

||| |||||| |||||||||||| |||||||||||||||| |||

|||||||||||||| |||||||||| |||||||| ||||||||||||||| ||||||| ||||||||||||| || | |

|

| | |

|

|

| |

|

|

| |

|

|

|

| | | |

| | ||| |

|

|

|

|| |

|

|

|

| |

| | || || | |

||||| ||||||| | ||||| || ||

| || || ||| | ||| ||

|||| |||||||| ||||||||||||||| | | |

| | | | | |

|

|| |

|| || |||| | ||||| || |||| |

||| || ||| | | | | |

|

| | |

|||||| | ||||||||| || || ||| |

|||| || | || | || | | |

| | |

|

| | |

|

| | || || | |

|

| | |

| ||||| |||| ||| || ||| | |||||||

| |

|

|

| |

|

| | | ||||| ||| | |

||| | | || | | | |

| | |

| | |

|| |||||||||||||||||||||||| ||||||||||||||

P r( W ag e> 25 0 | A ge )

(8)

Polynomial regression

I In the left-hand panel of the figure, the solid blue curve is given by f (x) = ˆ ˆ β 0 + ˆ β 1 x + ˆ β 2 x 2 + ˆ β 3 x 3 + ˆ β 4 x 4

and the pair of dotted blue curves indicate an estimated 95%

confidence interval given by

f (x) ˆ ± 2 · se{ ˆ f (x) }

I In the right-hand panel, the solid blue curve is given by ˆ

π(y > 250 |x) = exp{ ˆ f (x) }/[1 + exp{ ˆ f (x) }] = sigm{ ˆ f (x) } and the pair of dotted blue curves indicate an estimated 95%

confidence interval given by

sigm[ ˆ f (x) ± 2 · se{ ˆ f (x) }]

(9)

Piecewise polynomials

A step function (a piecewise polynomial of order zero) can be used to avoid imposing a global structure

Cutpoints or knots c 1 , c 2 , . . . , c K in the range of x are chosen and are used to create K + 1 dummy variables

C 0 (x) = I(x < c 1 ) C 1 (x) = I(c 1 ≤ x < c 2 )

.. . .. .

C K−1 (x) = I(c K−1 ≤ x < c K ) C K (x) = I(x ≥ c K )

Least squares is used to fit

f (x) = β 0 + β 1 C 1 (x) + β 2 C 2 (x) + . . . + β K C K (x)

Referenties

GERELATEERDE DOCUMENTEN

“Two-point spectral model for variable- density homogeneous turbulence,” Bulletin of American Physical Society 63(14), 350-351, presented at the 71 st Annual Meeting of the

sersbond) de aktie &#34;Fietsen voor Nicaragua&#34;. Het doel van deze aktie is geld in te zamelen voor fietsen voor begeleiders van groepjes, die in hun vrije tijd les

Er is een aantal niveau's te onderscheiden waarop de berekening van de vei ligheid van duinen kan worden uitgevoerd. Hierbij wordt de werkelijk- heid steeds beter benaderd naarmate

• Is het voor het uitvoeren van de plannen of het verrichten van de werkzaamheden noodzakelijk om ontheffing (ex art. 75 van de Flora- en faunawet) van de verbodsbepa- lingen aan

Verder bleek bij vergelijking van de berekende afvoercijfers van de hoogwaters in 1965 en 1966, met de Duitse afvoercijfers te Stah, dat de laatste tot 50 m3/s lager waren

7. De flowcytometer meet geen bepaald volume monster door maar meet een bepaalde tijd. voor monsters van verschillende dichtheid en viscositeit betekent dat dat er een

Research question: In which way do Eritrean status (&gt;18) holders experience building a new network in the city of Groningen.. The main question will be answered with the

Within the framework of the TREC and recently also the CLEF information re- trieval evaluation initiatives, TNO TPD has tested several approaches to cross language information