Week1 Combined

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 38

Time Series: Week 1 Lecture Slides

1 / 36
Introduction I
▶ This course will teach you a number of econometric tools for
analyzing time series data (financial, macroeconomic, etc.)
▶ Time series data = data measured over time
▶ If you have enough measurements of the same quantity over time
(say at least 30-40), you can apply the methods in this course

2 / 36
Introduction II

▶ Examples of things you’ll learn in the course:


▶ How to model the dynamic behaviour of and forecast, e.g., stock
prices, interest rates, exchange rates
▶ How to write down the right model, based on your question and the
characteristics of your data
▶ How to test your model
▶ How to evaluate whether empirical studies make sense

3 / 36
Introduction III

▶ Time series analysis presents different challenges than


cross-sectional and panel econometrics
▶ You will have to select a model, and there are many possibilities (→
you will know what are the most popular classes of models)
▶ The model you select should be compatible with your data (→ you
will learn what to look out for)
▶ If you select the wrong model, your inference could be completely
wrong (→ this won’t happen after taking this course!)
▶ There are new things to worry about even after you have selected
the right model (→ and you will learn them)

4 / 36
Introduction IV

▶ Some things are similar to cross-sectional and panel econometrics


▶ You can still write down regression models (just change the
subscript i for t)
▶ The estimation methods are the same you already know (OLS,
Maximum Likelihood, Method of Moments,...)
▶ You will still do inference using large sample (asymptotic)
approximations

5 / 36
Course outline

1. Introduction: time series data and examples of empirical questions


2. Regression with time series data
2.1 Asymptotic theory under stationarity and ergodicity assumptions
2.2 OLS estimation
2.3 HAC estimators of standard errors
3. Univariate models
3.1 Models of conditional mean
3.2 Relaxing the assumption of stationarity
3.3 Model selection

With Raffaella: Models of conditional variance, Multivariate Models,


Forecasting

6 / 36
Examples of empirical questions

7 / 36
Examples of empirical questions
▶ Predicting the stock market: will the SP500 index go up or down
tomorrow?
▶ People who don’t know time series use the informal ”technical
analysis” below. You will learn how to write down a formal model
(and know what the best answer to the above question is)

8 / 36
Examples of empirical questions
▶ Can we model and predict the volatility/uncertainty in financial
markets?
▶ You will learn how to write down models that can replicate the
volatility clustering in the data, which turns out is predictable

9 / 36
Examples of empirical questions
▶ Is the behaviour of interest rate now the same as it was 50 years
ago? (Or: should I use very old data in my estimation?)

▶ Are stock price dynamics different during booms and recessions?


▶ Your will learn how to test and model structural change

10 / 36
Examples of empirical questions
▶ Did the odds of Trump being elected in 2016 cause a stock market
decline before the election?
▶ Or, should I believe my eyes if I see correlation?
▶ You will learn simple ways to detect spurious correlation

11 / 36
Examples of empirical questions
▶ Key question for policy during the pandemic: link between covid
cases and hospitalisations.
▶ Need to model the dynamic relationship and understand whether it
is stable.

12 / 36
The formal framework

13 / 36
Introduction to the formal framework

▶ Goal is to lay out a rigourous framework to think about time series


(and compare it to other forms of econometrics).
▶ Slides are going to be a little abstract.
▶ But accompanying recording with examples (in excel!) should help
make the concepts clearer.
▶ See also Section 1.2 in Tsay (2010).

14 / 36
Basic Notation

▶ Sample is {yt } := {yt : t = 1, 2, ..., T }


▶ We think of {yt } := {yt : t = 1, 2, ...} as a sequence of random
variables → stochastic process
▶ if yt ∈ R, univariate time series (goal: model individual dynamics)
▶ if yt ∈ RN , multivariate time series (goal: model joint dynamics
and dependence among variables)

15 / 36
Comparison to cross-sectional econometrics

▶ in a cross section y1 , .., yT are independent and identically


distributed (iid) – recall we can swap t for i.
▶ in time series y1 , ..., yT are dependent (which implies serially
correlated or autocorrelated) and may not be identically
distributed
▶ We are interested in the dynamic behavior of yt , described by a
data-generating process (DGP) that we approximate by a model.
The model is dynamic → we can do forecasting

16 / 36
Comparison to panel econometrics

▶ Traditionally,
▶ Different questions:
▶ Panel: interest in contemporaneous ”causal” relationships, use T to
eliminate endogeneity
▶ Time series: interest in modelling dynamic relationships (how yt
depends on its past)
▶ Different assumptions about relative sizes of time series dimension
T and cross sectional dimension N
▶ Panel: small T , large N
▶ Time series: large T (particularly finance), small N
▶ This is changing and lines are blurring (e.g., ”big data” = large
N,large T )

17 / 36
The formal framework

▶ yt has an unconditional density f (yt ), a conditional density


f (yt |yt−1 , yt−2 , ...) = f (yt |Ωt−1 ),
▶ Ωt−1 = information set at time t − 1

18 / 36
The formal framework

▶ yt has an unconditional density f (yt ), a conditional density


f (yt |yt−1 , yt−2 , ...) = f (yt |Ωt−1 ),
▶ Ωt−1 = information set at time t − 1
▶ We can model and forecast the full conditional density (e.g., risk
management, finance) or just focus on
▶ conditional mean E(yt |Ωt−1 ) (macro applications)
▶ conditional variance Var (yt |Ωt−1 ) (finance applications)

18 / 36
The formal framework

▶ yt has an unconditional density f (yt ), a conditional density


f (yt |yt−1 , yt−2 , ...) = f (yt |Ωt−1 ),
▶ Ωt−1 = information set at time t − 1
▶ We can model and forecast the full conditional density (e.g., risk
management, finance) or just focus on
▶ conditional mean E(yt |Ωt−1 ) (macro applications)
▶ conditional variance Var (yt |Ωt−1 ) (finance applications)
▶ We will consider parametric models

E (yt |Ωt−1 ) = g (Ωt−1 ; β)

▶ and estimate the population parameter β by an estimator β̂

18 / 36
Regression with time series data

19 / 36
Introduction to regression with time series data

▶ When introducing the formal framework we discussed parametric


models
E (yt |Ωt−1 ) = g (Ωt−1 ; β)
▶ and estimating the population parameter β by an estimator β̂
▶ An obvious starting point is to assume g is linear in Ω.
▶ Goal: So can we use standard regression techniques to estimate β̂?

20 / 36
Regression with time series data

▶ In the Trump election example, we could try to see if the daily


odds of Trump winning (xt ) affected the SP500 index (yt ) by
running a regression
yt = βxt + ut
▶ Can we estimate β by OLS, compute standard errors using
asymptotic approximations, and test if β = 0?
▶ The answer is yes to estimation by OLS, but we must be very
careful about:
▶ whether the assumption required to use asymptotic approximations
are valid
▶ using the correct standard errors

21 / 36
Trump Election Example

22 / 36
Why issues arise

In time series analysis we could have the following:


1 The current value of xt is a function of past yt so
Cov(xt , yt−s ) ̸= 0.
▶ The lags yt can be explanatory variables, e.g. xt = yt−1 . Typical
with univariate models.
2 Var(ut ) depends on current and past observations of xt or past ut .
Item 1 means that xt is only weakly exogenous. OLS biased but
consistent. Rely on (large T ) asymptotics.
Item 2 means that the standard errors need to adjusting. Cannot
assume homoscedasticity (discuss in week 2).

23 / 36
Asymptotics and Stationarity

24 / 36
When can we use LS?

▶ We can use OLS to obtain an estimate β̂.


▶ But we said only have weak exogeneity. So we rely on (large T )
asymptotics.
▶ Goal: understand what this means and some assumptions for:
▶ when β̂ will be consistent (we can’t achieve unbiasedness).
▶ what the asymptotic distribution of the estimate will be for
inference.

25 / 36
Asymptotic theory

▶ Asymptotic theory = properties of estimators as T → ∞


▶ Imagine we have a sample: {yt } := {yt : t = 1, 2, ..., T } and
sample mean y
▶ Law of Large Number and Central Limit Theorem given restrictions
on the heterogeneity (e.g., identically distributed) and
dependence (e.g., independent) in the data:
▶ LLN : y√→p µ √
▶ CLT : T (y − µ) →d N(0, Var ( T y ))
▶ Heterogeneity = how much f (yt ) changes with t
▶ Dependence = how much yt depends on its past values

26 / 36
Stationarity and Ergodicity

▶ Main difference: In time series we cannot assume iid, but can still
have LLNs and CLTs by replacing the iid assumption with, for
example, stationarity + ergodicity (there are other assumptions)
▶ Stationarity (restricts heterogeneity):
▶ Strict stationarity (strong) = joint distribution of (yt , yt+j1 , ..., yt+jn )
does not depend on t for any set of indeces (j1 , ..., jn ) and for any n
▶ Covariance-stationarity (weak) = only unconditional mean, variance
and covariances do not depend on t
▶ Ergodicity (restricts dependence):
▶ The covariance between yt and yt−j goes to zero quickly as j gets
large (sometimes called weak dependence)

27 / 36
Asymptotics of time series OLS estimators

▶ If both yt and xt are stationary and yt is ergodic. Then two


properties of β̂:
▶ consistency: β̂ gets close to β as T → ∞: proven by the Law of
Large Numbers (LLN). Still requires weak exogeneity.
▶ asymptotic normality: β̂ is approximately normal as T → ∞ :
proven by the Central Limit Theorem (CLT)

28 / 36
Examples of non-stationarity

▶ Lets use FX data to show some examples of non-stationary data.


▶ In general, most FX data have unit roots (will come back to formal
definition)...
▶ ...but can also have trends...
▶ or structural breaks...
▶ in levels or in volatilities.

29 / 36
Trending data: USDTRY

30 / 36
Structural Breaks in Level: GBPUSD

31 / 36
Structural Breaks in Volatility: GBPUSD

32 / 36
Why are time series models biased? I
▶ Recall the basic regression model
yt = βxt + ut
where ut ∼ i.i.d.(0, σ 2 ).
▶ We have P T PT
xt yt xt ut
β̂ = Pt=1
T
= β + Pt=1
T
2 2
t=1 xt t=1 xt
▶ So in expectation
PT !
xt ut
E(β̂) = β + E Pt=1
T 2
t=1 xt
▶ Strict exogeneity means E(ut | xT , xT −1 , ..., x1 ) = 0
▶ Applying law of iterated expectations
PT ! PT !
t=1 xt ut t=1 xt E(ut | xT , xT −1 , ..., x1 )
E PT =E PT =0
2 2
t=1 xt t=1 xt

33 / 36
Why are time series models biased? II
▶ Simple time series model

yt = βyt−1 + ut

where ut ∼ i.i.d.(0, σ 2 ).
▶ So in expectation
PT !
yt−1 ut
E(β̂) = β + E Pt=2
T 2
t=2 yt−1

▶ E(ut | yt−1 ) = 0 but E(ut | yt , yt−1 , ...) = yt − βyt−1


▶ And ! !
PT PT
y t−1 u t E(y t−1 ut )
E Pt=2
T 2
̸= Pt=2T 2
=0
y
t=2 t−1 t=2 E(yt−1 )
▶ Turns out the bias is downward.

34 / 36
Why are time series models consistent?

▶ HoweverT −1 T p
P
t=2 yt−1 ut → E(yt−1 ut ) = 0
▶ And T −1 T 2 p 2
P
t=2 yt−1 → E(y )
▶ And so PT
yt−1 ut p E(yt−1 ut )
Pt=2
T
→ =0
2
t=2 yt−1
E(y 2 )
▶ Key point is that there is no Jensen’s equality issue with probability
limits.

35 / 36
Bottom lines

▶ As long as we can appeal to LLNs and CLTs inference on β̂ is


similar to the cross section case.
▶ Plotting the data can help.
▶ We will move on to the formal properties of the LS estimator if the
data is stationary and ergodic.
▶ We will discuss how to test for issues and how to deal with major
exceptions (e.g. unit roots).

36 / 36

You might also like