Lecture 16 Flashcards
What is time series
You observe one unit repeatedly over time
- e.g. quarterly GDP
Whats the point of time series?
Time series analysis is incredibly useful in real-world applications where things evolve over time
- forecasting: predict future GDP, inflation
- dynamic causal effects: understand not just if something has an affect, but when
- modelling risks
Technical challenges in time series
- Not a random sample, same unit so can we generalist?
- Observations are correlated over time, if GDP is high today, probably high tomorrow too, so OLS assumption of independent errors violated
- Lagged variables matter, past values often help explain current outcomes
- Serial correlation in errors, SEs will be wrong unless corrected
- Small samples
Key notation for time series:
Yt is the value of some variable
- dataset is a sequence {y1,y2,…,yt} is a single variable observed over time
- first loaf of yt is just the value from the previous time, yt-1
- when we apply the log before differencing, we approximate the percentage change in y
Autovariance
Measures how two values of the same series at different times move together
- e.g. cov(yt,yt-1)
Autocorrelation
Normalises the autocovariance, i.e., scales it so its between -1 and 1
- p1 = corr(yt,yt-1) = ((cov(yt,yt-1))/ROOT(var(yt).var(yt-1)))
- tells us how strongly yt is linearly related to its own past
- extends to any lag k, so corr(yt,yt-j) and cov(yt,yt-j)
How to estimate autocorrelation from data
Sample autocorrelation at lag j:
Pj^ = (cov^(yt,yt-j))/(var(yt))
- Whats the calculation for the numerator? The average of product of deviations from the mean, at times t and t-j, across the sample
- note, you’re summing from t = j+1 to T, asa you need both yt and yt-j to exist. Normalizing by the variance of yt in the denominator
Why does the autocorrelation matter?
- high autocorrelation means past values are informative, might want to include them in models
- low or no autocorrelation means the series is more random or less predictable
Definition of autocovariance
Measures how much a time series value at time t and a lagged value at time t-j co-vary. Captures the strength and direction of the linear relationship between those two points in time
Definition of autocorrelation
The normalised version of autocovariance, scales it to lie between -1 and 1
- 1 is perfect positive autocorrelation and vice versa, 0 is no autocorrelation.
The least squares assumptions for time series data
- denote Xt = (x1,x2,…,xt)’
- yt = B0 + X’.B1 + X’t-1.B2 + … X’t-p.Bp+1 + ut
- MLR.1 - linear in parameters, yes
- MLR.3 - no perfect collinearity, yes
- MLR.4 - zero conditional mean, we can go beyond and say error at time t is uncorrelated with entire history and future of the regressors
MLR.2 for time series regression
I.i.d no longer make sense
- the replacement is ‘stationarity’, a time series yt is stationary if its probability distribution doesn’t change over time
- mean and variance stays constant, and covariance between lags and yt depends on lag length not time itself.
Now consider joint stationarity
Means the joint distribution of a collection of time series variables does not depend on time
- so if you slide your time window forward or back, statistical relationships don’t change
E.g. if you’re tracking the temp at noon every day, if the distribution of temp on days 1-5 is the same as 10–105, then series is jointly stationary
What does ‘covariance only depends on how far apart’ means
Let’s say:
- cov(y100,y99) = 50, so covariance between adjacent days
Then, cov(y78,y77) = 50 also as only the lag matters.
Whats second order stationarity
- only care about mean and variance being constant not the next moments
- covariance between two still depends only on the time gap
- much more realistic, we dont care about skewness, Kurtosis or whether the ENTIRE distribution stays the same.
What do we do with the independence assumption
We relax and assume weak dependence,
- still correlation across time
- that correlation decays, as the time gap increases.
Assume Ergodicity:
- averages over time behave like averages over a large number of individuals, where the idea is that as you observe the process for long enough, dependence becomes negligible.
So finally, what are the properties of OLS in time series (5)
- TS1 - linear in parameters
- TS2 - strict exogeneity
- TS3 - no perfect collinearity
- TS4 - stationarity
- TS5 - weak dependence/ ergodicity
Under 1-3, OLS is unbiased and under all 6, OLS is consistent and asymptotically normal, due to CLT
Issue with strict exogeneity
Hardest assumption to meet
- variables evolve over time
- current or future variables may depend on past chocks
- as OLS becomes biased, RHS variables no longer predetermined
- reverse causality or autoregression can violate strict exogeneity
Proof assumption of normal exogeneity is not enough in time series
We have bias, and assuming Xt^ depend on past shocks, then numerator and denominator are correlated, so expectation does not simplify to 0 and OLS is biased
- via ergodic theorem, which says time averages converge to expectations, so even with bias in small samples, OLS is consistent and asymptotically normal
- without strict exogeneity, OLS is biased due to time dependence, but with stationarity and ergodicity, we can rely on large samples to recover right answer
CLT and ergodicity
If time series data is ergodic, and stationary, then by a time series version of the CLT, the OLS estimator’s distribution looks more and more like a normal distribution as T tends to infinity.
Is OLS BLUE in time series?
Even if you have homoskedastic errors, OLS is not BLUE unless, errors are serially uncorrelated, so ut and ut-1 are independent.