Professional Documents
Culture Documents
Chapter 2
Chapter 2
Chapter 2
Autocorrelation
Function
Rob Reider
Adjunct Professor, NYU-Courant
Consultant, Quantopian
DataCamp Introduction to Time Series Analysis in Python
Autocorrelation Function
Autocorrelation Function (ACF): The autocorrelation as a function of
the lag
Equals one at lag-zero
Interesting information beyond lag-one
DataCamp Introduction to Time Series Analysis in Python
Import module:
Example: alpha=0.05
Let's practice!
DataCamp Introduction to Time Series Analysis in Python
White Noise
Rob Reider
Adjunct Professor, NYU-Courant
Consultant, Quantopian
DataCamp Introduction to Time Series Analysis in Python
Let's practice!
DataCamp Introduction to Time Series Analysis in Python
Random Walk
Rob Reider
Adjunct Professor, NYU-Courant
Consultant, Quantopian
DataCamp Introduction to Time Series Analysis in Python
Pt = Pt−1 + ϵt
Pt = Pt−1 + ϵt
Pt − Pt−1 = ϵt
Pt = Pt−1 + ϵt
Pt = μ + Pt−1 + ϵt
Pt − Pt−1 = μ + ϵt
DataCamp Introduction to Time Series Analysis in Python
Pt = μ + Pt−1 + ϵt
Pt = α + β Pt−1 + ϵt
Test:
H0 : β = 1 (random walk)
Pt = α + β Pt−1 + ϵt
Equivalent to
Pt − Pt−1 = α + β Pt−1 + ϵt
Test:
H0 : β = 0 (random walk)
Pt − Pt−1 = α + β Pt−1 + ϵt
Test:
H0 : β = 0 (random walk)
If you add more lagged changes on the right hand side, it's the
Augmented Dickey-Fuller test
DataCamp Introduction to Time Series Analysis in Python
adfuller(x)
DataCamp Introduction to Time Series Analysis in Python
Print p-value
print(results[1])
0.782253808587
Let's practice!
DataCamp Introduction to Time Series Analysis in Python
Stationarity
Rob Reider
Adjunct Professor, NYU-Courant
Consultant, Quantopian
DataCamp Introduction to Time Series Analysis in Python
What is Stationarity?
Strong stationarity: entire distribution of data is time-invariant
Weak stationarity: mean, variance and autocorrelation are time-
invariant (i.e., for autocorrelation, corr(Xt , Xt−τ ) is only a function of
τ)
DataCamp Introduction to Time Series Analysis in Python
Why Do We Care?
If parameters vary with time, too many parameters to estimate
Can only estimate a parsimonious model with a few parameters
DataCamp Introduction to Time Series Analysis in Python
Let's practice!