Professional Documents
Culture Documents
Sören Künzel
srk@berkeley.edu
Sören Künzel (UC Berkeley) Stat 153: Lecture 1 Monday 31st October, 2016 1 / 13
Google Trend
80
60
40
20
0
Weekly Time
Sören Künzel (UC Berkeley) Stat 153: Lecture 1 Monday 31st October, 2016 2 / 13
Google Trend
80
60
40
20
0
Weekly Time
Sören Künzel (UC Berkeley) Stat 153: Lecture 1 Monday 31st October, 2016 2 / 13
White Noise
white noise
30
10
−10
Series noise
−30
Weekly Time
ACF
0.4
0.0
Series noise
0 5 10 15 20
0.10
Lag
Partial ACF
−0.10 0.00
5 10 15 20
X1 , . . . , Xn are called white noise if they have mean zero, variance 2 and
are uncorrelated.
Sören Künzel (UC Berkeley) Stat 153: Lecture 1 Monday 31st October, 2016 3 / 13
Trend and Seasonality
X t = m t + s t + Zt
Sören Künzel (UC Berkeley) Stat 153: Lecture 1 Monday 31st October, 2016 4 / 13
Trend and Seasonality
100
50
no trend
0
−50
−100
150
100
50
with trend
0
−50
−100
Sören Künzel (UC Berkeley) Stat 153: Lecture 1 Monday 31st October, 2016 5 / 13
Exploiting Trend and Seasonality
Trend, mt Seasonality, st
Parametric Parametric
(e.g. fit a quadratic model) (e.g fit sinusoidal functions)
Non-parametrically Non-parametrically
(linear filters) (e.g. ŝi = ave(Xi , Xi+d , . . .))
Di↵erencing Di↵erencing
Sören Künzel (UC Berkeley) Stat 153: Lecture 1 Monday 31st October, 2016 6 / 13
Parametric Trend Estimation
e.g.
Berkeley Search Popularity
Y = 1 t + 2 t 2 +c
80
70
60
50
40
30
Weekly Time
Sören Künzel (UC Berkeley) Stat 153: Lecture 1 Monday 31st October, 2016 7 / 13
Parametric Trend Estimation
e.g.
Berkeley Search Popularity
Y = 1 t + 2 t 2 +c
80
70
Weekly Time
Sören Künzel (UC Berkeley) Stat 153: Lecture 1 Monday 31st October, 2016 7 / 13
Parametric Trend Estimation
e.g.
Berkeley Search Popularity
Y = 1 t + 2 t 2 +c
80
70
Weekly Time
Sören Künzel (UC Berkeley) Stat 153: Lecture 1 Monday 31st October, 2016 7 / 13
Parametric Trend Estimation
e.g.
Berkeley Search Popularity
Y = 1 t + 2 t 2 +c
80
70
Weekly Time
Sören Künzel (UC Berkeley) Stat 153: Lecture 1 Monday 31st October, 2016 7 / 13
Parametric Seasonality Estimation
Seasonality Model
X t = s t + Zt
Parametric
Use a linear model to estimate a and b in
k
X
ŝt = a0 + (aj cos(2⇡ft/d) + bj sin(2⇡ft/d)).
f =1
Sören Künzel (UC Berkeley) Stat 153: Lecture 1 Monday 31st October, 2016 8 / 13
Non–Parametric Seasonality Estimation
trend
90
Berkeley Search Popularity
80
70
60
50
40
30
Weekly Time
Sören Künzel (UC Berkeley) Stat 153: Lecture 1 Monday 31st October, 2016 9 / 13
Non–Parametric Seasonality Estimation
trend
20
Popularity − Fitted Trend
10
0
−10
Weekly Time
Sören Künzel (UC Berkeley) Stat 153: Lecture 1 Monday 31st October, 2016 9 / 13
Non–Parametric Seasonality Estimation
trend
2.) Choose a model,
20
Popularity − Fitted Trend
e.g.
10
k = 26
0
−10
Weekly Time
Sören Künzel (UC Berkeley) Stat 153: Lecture 1 Monday 31st October, 2016 9 / 13
Non–Parametric Seasonality Estimation
trend
2.) Choose a model,
20
Popularity − Fitted Trend
e.g.
10
k = 26
3.) Fit the model
0
−10
Weekly Time
Sören Künzel (UC Berkeley) Stat 153: Lecture 1 Monday 31st October, 2016 9 / 13
Non–Parametric Seasonality Estimation
trend
2.) Choose a model,
20
Popularity − Fitted Trend
e.g.
10
k = 26
3.) Fit the model
0
4.) Predict
−10
Weekly Time
Sören Künzel (UC Berkeley) Stat 153: Lecture 1 Monday 31st October, 2016 9 / 13
Non–Parametric Seasonality Estimation
trend
2.) Choose a model,
20
Popularity − Fitted Trend
e.g.
10
k = 26
3.) Fit the model
0
4.) Predict
5.) Test the model,
−10
Weekly Time
Sören Künzel (UC Berkeley) Stat 153: Lecture 1 Monday 31st October, 2016 9 / 13
Non-Parametric Seasonality Estimation
Seasonality Model
X t = s t + Zt
Non-Parametric Estimator
Note that s is completely determined by s1 , . . . , sd and thus estimate for
i 2 {1, . . . , d} :
ŝi = average(xi , xi+d , xi+2d , . . .)
Sören Künzel (UC Berkeley) Stat 153: Lecture 1 Monday 31st October, 2016 10 / 13
Combining Trend Estimator and Seasonality Estimator
80
70
60
50
40
30
80
70
60
50
40
30
4
50
40
3
log(crime)
30
crime
2
20
1
10
0
0
0 50 100 150 200 250 300 0 50 100 150 200 250 300
Sören Künzel (UC Berkeley) Stat 153: Lecture 1 Monday 31st October, 2016 12 / 13