1/25
Section 6 : Cross − Validation
Yotam Shem-Tov Fall 2014
Yotam Shem-Tov STAT 239/ PS 236A
Section 6 : Cross Validation Yotam Shem-Tov Fall 2014 1/25 Yotam - - PowerPoint PPT Presentation
Section 6 : Cross Validation Yotam Shem-Tov Fall 2014 1/25 Yotam Shem-Tov STAT 239/ PS 236A In Sample prediction error There are two types of Prediction errors: In sample prediction error and out of sample prediction error. In sample
1/25
Yotam Shem-Tov STAT 239/ PS 236A
2/25
N
i=1(yi − ˆ
N
i=1(yi − ˆ
Yotam Shem-Tov STAT 239/ PS 236A
3/25
Yotam Shem-Tov STAT 239/ PS 236A
4/25
1 Split the data into a training set and a test set 2 Build a model on the training data 3 Evaluate on the test set 4 Repeat and average the estimated errors
1 Choosing model parameters 2 Model selection 3 Picking which variables to include in the model Yotam Shem-Tov STAT 239/ PS 236A
5/25
1 Random sub-sampling CV 2 K-fold CV 3 Leave one out CV (LOOCV)
Yotam Shem-Tov STAT 239/ PS 236A
6/25
1 Randomly split the data into a test set and training set. 2 Fit the model using the training set, without using the test set
3 Evaluate the model using the test set 4 Repeat the procedure multiple times and average the
Yotam Shem-Tov STAT 239/ PS 236A
7/25
−0.2 0.2 0.4 0.6 0.8 1 2 3 4
No interactions
P−score Density Treatment Control 0.0 0.5 1.0 1 2 3 4
With interactions
P−score Density Treatment Control Yotam Shem-Tov STAT 239/ PS 236A
8/25
Yotam Shem-Tov STAT 239/ PS 236A
9/25
Model 2 0.20 0.25 0.30 0.35 0.40 0.45 0.50 Yotam Shem-Tov STAT 239/ PS 236A
10/25
Yotam Shem-Tov STAT 239/ PS 236A
11/25
Yotam Shem-Tov STAT 239/ PS 236A
12/25
Yotam Shem-Tov STAT 239/ PS 236A
13/25
n
i ˆ
Yotam Shem-Tov STAT 239/ PS 236A
14/25
1
2
Yotam Shem-Tov STAT 239/ PS 236A
15/25
1 Build a model using the first M periods 2 Evaluate the model on period t = (M + 1) : T 3 Build a model using the first M + 1 periods 4 Evaluate the model on period t = (M + 2) : T 5 Continue iterating forward until, M + 1 = T 6 Average over the estimated errors Yotam Shem-Tov STAT 239/ PS 236A
16/25
1
2
3
Yotam Shem-Tov STAT 239/ PS 236A
17/25
10 15 1970 1980 1990 2000 2010
year growth
Yotam Shem-Tov STAT 239/ PS 236A
18/25
∗∗∗p < 0.001, ∗∗p < 0.01, ∗p < 0.05 Yotam Shem-Tov STAT 239/ PS 236A
19/25
Yotam Shem-Tov STAT 239/ PS 236A
20/25
Yotam Shem-Tov STAT 239/ PS 236A
21/25
Yotam Shem-Tov STAT 239/ PS 236A
22/25
Yotam Shem-Tov STAT 239/ PS 236A
23/25
Yotam Shem-Tov STAT 239/ PS 236A
24/25
Yotam Shem-Tov STAT 239/ PS 236A
25/25
Yotam Shem-Tov STAT 239/ PS 236A