phd macroeconomics 1: 1. difference equations and ...second order di erence equations: 1 consider...

43
PhD Macroeconomics 1: 1. Difference Equations and Introduction to Time Series Karl Whelan School of Economics, UCD Autumn 2019 Karl Whelan (UCD) Difference Equations and Time Series Autumn 2019 1 / 43

Upload: others

Post on 05-Mar-2020

7 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: PhD Macroeconomics 1: 1. Difference Equations and ...Second Order Di erence Equations: 1 Consider the following second-order equation y t + a 1y t 1 + a 2y t 2 = c The constant solution

PhD Macroeconomics 1:1. Difference Equations and Introduction to Time

Series

Karl Whelan

School of Economics, UCD

Autumn 2019

Karl Whelan (UCD) Difference Equations and Time Series Autumn 2019 1 / 43

Page 2: PhD Macroeconomics 1: 1. Difference Equations and ...Second Order Di erence Equations: 1 Consider the following second-order equation y t + a 1y t 1 + a 2y t 2 = c The constant solution

Part I

Difference Equations

Karl Whelan (UCD) Difference Equations and Time Series Autumn 2019 2 / 43

Page 3: PhD Macroeconomics 1: 1. Difference Equations and ...Second Order Di erence Equations: 1 Consider the following second-order equation y t + a 1y t 1 + a 2y t 2 = c The constant solution

A Very Simple Difference Equation

Difference equations describe discrete-time dynamics.

Consider the simplest possible linear difference equation

xt = λxt−1

We assume this equation has always held, so that means

xt = λxt−1 = λ2xt−2 = .... = λtx0

What kind of dynamics will this equation imply? It depends on the value of λ

I λ > 1: Explosive dynamics in which the series heads steadily for plus orminus infinity, depending on whether x0 is positive or negative.

I λ = 1: Series remains unchanged.I 0 < λ < 1: Smooth dynamics in which the series heads steadily towards

zero from its starting point.I λ = 0: Series set equal to zero after period zero and stays there.I −1 < λ < 0: Damped oscillations, settling down at zero.I λ < −1: Exploding oscillations

Karl Whelan (UCD) Difference Equations and Time Series Autumn 2019 3 / 43

Page 4: PhD Macroeconomics 1: 1. Difference Equations and ...Second Order Di erence Equations: 1 Consider the following second-order equation y t + a 1y t 1 + a 2y t 2 = c The constant solution

First-Order Difference Equation Paths With DifferentValues of Lambda

Karl Whelan (UCD) Difference Equations and Time Series Autumn 2019 4 / 43

Page 5: PhD Macroeconomics 1: 1. Difference Equations and ...Second Order Di erence Equations: 1 Consider the following second-order equation y t + a 1y t 1 + a 2y t 2 = c The constant solution

RATSThe previous graph was generated using the econometric software RATS(Regression Analysis for Time Series).

I will be introducing you to the use of RATS for analysing macrodata andsimulating models.

RATS is a little old-fashioned but there are good reasons to use it for thismodule.

I It is easily available via Apps Anywhere on UCD Connect.I It has simple commands that allow for estimation and simulation of both

time series models such as VARs and more complex DSGE-style models.I It has a simple and intuitive command structure that facilitates

simulating models and calculating properties of estimators.I I have used RATS for years, so I have a large collection of programmes

that I can share with you illustrating various types of work.

RATS is not good at everything e.g. it is not good at analysing non-linearmodels or models with constraints. For that we need more powerful code tosolve dynamic programming problems. Later, I plan to give a basicintroduction to the use of Python for solving such models.

Karl Whelan (UCD) Difference Equations and Time Series Autumn 2019 5 / 43

Page 6: PhD Macroeconomics 1: 1. Difference Equations and ...Second Order Di erence Equations: 1 Consider the following second-order equation y t + a 1y t 1 + a 2y t 2 = c The constant solution

RATS Code for Previous Graph

Karl Whelan (UCD) Difference Equations and Time Series Autumn 2019 6 / 43

Page 7: PhD Macroeconomics 1: 1. Difference Equations and ...Second Order Di erence Equations: 1 Consider the following second-order equation y t + a 1y t 1 + a 2y t 2 = c The constant solution

Adding a Random Normal Shock With Standard Deviationof 0.5

Karl Whelan (UCD) Difference Equations and Time Series Autumn 2019 7 / 43

Page 8: PhD Macroeconomics 1: 1. Difference Equations and ...Second Order Di erence Equations: 1 Consider the following second-order equation y t + a 1y t 1 + a 2y t 2 = c The constant solution

Adding Random Shocks

Karl Whelan (UCD) Difference Equations and Time Series Autumn 2019 8 / 43

Page 9: PhD Macroeconomics 1: 1. Difference Equations and ...Second Order Di erence Equations: 1 Consider the following second-order equation y t + a 1y t 1 + a 2y t 2 = c The constant solution

Solving Difference Equations: 1

Consider the n-th order linear difference equation

yt + a1yt−1 + a2yt−2 + ...+ anyt−n = 0

This is called a homogenous difference equation because the constant term onthe right-hand-side is zero.

Guess that the solution is of the form yt = Abt and insert into the equation

Abt + a1Abt−1 + a2Ab

t−2 + ....+ anAbt−n = 0

Divide by Abt−n and this becomes

bn + a1bn−1 + a2b

n−2 + ....+ an = 0

This is an n-th order polynomial equation with up to n distinct possiblesolutions. This is known as the characteristic equation of the originaldifference equation.

Karl Whelan (UCD) Difference Equations and Time Series Autumn 2019 9 / 43

Page 10: PhD Macroeconomics 1: 1. Difference Equations and ...Second Order Di erence Equations: 1 Consider the following second-order equation y t + a 1y t 1 + a 2y t 2 = c The constant solution

Solving Difference Equations: 2

Assuming n distinct roots, there are n different values b1, b2, ...., bn such thatyt = bti solves the difference equation.

Also yt = Aibti works as a solution for any Ai as do sums of different solutions.

This gives a general solution of the form

yt = A1bt1 + A2b

t2 + ...+ Anb

tn

We can be more specific about values of the Ai if we are given n “boundaryconditions”, i.e. the first n values of the series yt . This allows you to pindown a unique solution.

What if we have a non-homogenous equation?

yt + a1yt−1 + a2yt−2 + ...+ anyt−n = c

The constant solution below works and can be added to the solution of thehomogenous equation.

y∗ =c

1 + a1 + a2 + ....+ an

Karl Whelan (UCD) Difference Equations and Time Series Autumn 2019 10 / 43

Page 11: PhD Macroeconomics 1: 1. Difference Equations and ...Second Order Di erence Equations: 1 Consider the following second-order equation y t + a 1y t 1 + a 2y t 2 = c The constant solution

Second Order Difference Equations: 1

Consider the following second-order equation

yt + a1yt−1 + a2yt−2 = c

The constant solution isy∗ =

c

1 + a1 + a2

The characteristic equation is

b2 + a1b + a2 = 0

The solutions are given by

b1, b2 =−a1 ±

√a2

1 − 4a2

2

Karl Whelan (UCD) Difference Equations and Time Series Autumn 2019 11 / 43

Page 12: PhD Macroeconomics 1: 1. Difference Equations and ...Second Order Di erence Equations: 1 Consider the following second-order equation y t + a 1y t 1 + a 2y t 2 = c The constant solution

Second Order Difference Equations: 2There are three types of solutions.

Case 1: Real Distinct Roots: a21 − 4a2 > 0 and the solution is of the form

yt = y∗ + A1bt1 + A2b

t2

Case 2: Real Repeated Roots: a21 − 4a2 = 0 so the solution of the

characteristic equation is just b = − a1

2 and the solution is of the form

yt = y∗ + (A1 + A2t)(a1

2

)tThe additional type of solution A2t

(a1

2

)tonly works when there are two

repeated roots.

Case 3: Complex Roots: a21 − 4a2 < 0 so the characteristic equation has

two complex solutions b1, b2 = h ± iv implying a solution to the differenceequation of the form

yt = y∗ + A1 (h + iv)t + A2 (h − iv)t

where h = − a1

2 and v =

√4a2−a2

1

2

Karl Whelan (UCD) Difference Equations and Time Series Autumn 2019 12 / 43

Page 13: PhD Macroeconomics 1: 1. Difference Equations and ...Second Order Di erence Equations: 1 Consider the following second-order equation y t + a 1y t 1 + a 2y t 2 = c The constant solution

Second Order Difference Equations with Complex Roots

What kind of behaviour do we get from the solution?

yt = y∗ + A1 (h + iv)t + A2 (h − iv)t

A way to characterise this behaviour in terms of known mathematicalfunctions is to express the complex numbers in polar form

h ± iv = R (cos θ + i sin θ)

where

R =√h2 + v2 =

√√√√(a1

2

)2

+

(√4a2 − a2

1

2

)2

= a122 (1)

θ = tan−1(vh

)(2)

De Moivre’s theorem can be used to characterise the solution as being of theform

yt = y∗ + B1 sin θt + B2 cos θt

Karl Whelan (UCD) Difference Equations and Time Series Autumn 2019 13 / 43

Page 14: PhD Macroeconomics 1: 1. Difference Equations and ...Second Order Di erence Equations: 1 Consider the following second-order equation y t + a 1y t 1 + a 2y t 2 = c The constant solution

Second-Order DE with Complex Roots with Two DifferentSets of Initial Conditions

Karl Whelan (UCD) Difference Equations and Time Series Autumn 2019 14 / 43

Page 15: PhD Macroeconomics 1: 1. Difference Equations and ...Second Order Di erence Equations: 1 Consider the following second-order equation y t + a 1y t 1 + a 2y t 2 = c The constant solution

RATS Code for Second-Order DE with Complex Roots

Karl Whelan (UCD) Difference Equations and Time Series Autumn 2019 15 / 43

Page 16: PhD Macroeconomics 1: 1. Difference Equations and ...Second Order Di erence Equations: 1 Consider the following second-order equation y t + a 1y t 1 + a 2y t 2 = c The constant solution

Example

Consider the following second-order equation

yt − 7yt−1 + 10xt−2 = 5

where y0 = 2 and y1 = 3.

The characteristic equation is

b2 − 7b + 10 = 0

with solutions b1 = 5 and b2 = 2.

A particular solution y∗ satisfies

y∗ − 7y∗ + 10y∗ = 5⇐⇒ y∗ =5

1− 7 + 10=

5

4

Calculate coefficients from

y1 = A1 + A2 + 54 = 2 (3)

y2 = 5A1 + 2A2 + 54 = 3 (4)

which solve to give A1 = − 13 and A2 = 5

3 . Solution is yt = − 13 5t + 5

3 2t + 54 .

Karl Whelan (UCD) Difference Equations and Time Series Autumn 2019 16 / 43

Page 17: PhD Macroeconomics 1: 1. Difference Equations and ...Second Order Di erence Equations: 1 Consider the following second-order equation y t + a 1y t 1 + a 2y t 2 = c The constant solution

Some Lessons

Depending on the coefficients, linear discrete time models can generatebehaviour that is explosive, zig-zag, smoothly convergent or oscillating.

The particular paths that processes take will depend upon the initialconditions.

Adding random shocks—making the difference equations stochastic—makesthe behaviour of the variables less mechanical but won’t undo the underlyingbehaviour in the deterministic version if the model is explosive or oscillating.

It’s easy to use RATS to simulate discrete time models, with or withoutrandom shocks.

Karl Whelan (UCD) Difference Equations and Time Series Autumn 2019 17 / 43

Page 18: PhD Macroeconomics 1: 1. Difference Equations and ...Second Order Di erence Equations: 1 Consider the following second-order equation y t + a 1y t 1 + a 2y t 2 = c The constant solution

Part II

Trends, Cycles, Impulse Responses and

Volatility

Karl Whelan (UCD) Difference Equations and Time Series Autumn 2019 18 / 43

Page 19: PhD Macroeconomics 1: 1. Difference Equations and ...Second Order Di erence Equations: 1 Consider the following second-order equation y t + a 1y t 1 + a 2y t 2 = c The constant solution

Getting Data: Meet FRED

One of the things you will do in this course is get macro data and do stuffwith it using RATS.

A popular source of macro data is the FRED site provided by the FederalReserve Bank of St. Louis. https://fred.stlouisfed.org

Karl Whelan (UCD) Difference Equations and Time Series Autumn 2019 19 / 43

Page 20: PhD Macroeconomics 1: 1. Difference Equations and ...Second Order Di erence Equations: 1 Consider the following second-order equation y t + a 1y t 1 + a 2y t 2 = c The constant solution

Getting Data from FREDFRED makes it easy to make charts and to quickly download data.

A spreadsheet downloaded from FRED contains preamble descriptive materialbefore the data like this. You should always keep this file to know exactlywhat your original source data are.

Karl Whelan (UCD) Difference Equations and Time Series Autumn 2019 20 / 43

Page 21: PhD Macroeconomics 1: 1. Difference Equations and ...Second Order Di erence Equations: 1 Consider the following second-order equation y t + a 1y t 1 + a 2y t 2 = c The constant solution

Getting Data from FRED to RATSTo analyse the data in RATS, get rid of the preamble material and the datesand save the data as an Excel 97-2003 worksheet. It should look like the clipbelow.

This can be read directly into RATS–you tell RATS what the starting dateand ending date are. The version of RATS on Apps Anywhere usually asksyou to confirm exactly which spreadsheet your data is in.

All the calculations below were done with this spreadsheet. The spreadsheetand the programme are available on Brightspace.

Karl Whelan (UCD) Difference Equations and Time Series Autumn 2019 21 / 43

Page 22: PhD Macroeconomics 1: 1. Difference Equations and ...Second Order Di erence Equations: 1 Consider the following second-order equation y t + a 1y t 1 + a 2y t 2 = c The constant solution

Reading the Data into RATS

The opening lines of the RATS programme that generates the charts in the restof these lecture notes:

Karl Whelan (UCD) Difference Equations and Time Series Autumn 2019 22 / 43

Page 23: PhD Macroeconomics 1: 1. Difference Equations and ...Second Order Di erence Equations: 1 Consider the following second-order equation y t + a 1y t 1 + a 2y t 2 = c The constant solution

Trends and Cycles

Macroeconomists tend to break series into a “non-stationary” long-run trendand a “stationary” cyclical component.

“Business cycle analysis” relates to this modelling and explaining the cyclicalcomponents of the major macroeconomic variables.

Fine in theory, but how is this done in practice?

Simplest method: Log-linear trend

I Estimated from regression

log(Yt) = yt = α + gt + εt

I Trend component α + gt.I Zero-mean stationary cyclical component εt .I Log-difference ∆yt (equivalent to growth rate) has two components:

Constant trend growth g and the change in cyclical component ∆εt .

Karl Whelan (UCD) Difference Equations and Time Series Autumn 2019 23 / 43

Page 24: PhD Macroeconomics 1: 1. Difference Equations and ...Second Order Di erence Equations: 1 Consider the following second-order equation y t + a 1y t 1 + a 2y t 2 = c The constant solution

Trends and Cycles in US GDP: Cycles Are Pretty Small

Karl Whelan (UCD) Difference Equations and Time Series Autumn 2019 24 / 43

Page 25: PhD Macroeconomics 1: 1. Difference Equations and ...Second Order Di erence Equations: 1 Consider the following second-order equation y t + a 1y t 1 + a 2y t 2 = c The constant solution

Simplest Example: Log-Linear Trend

Karl Whelan (UCD) Difference Equations and Time Series Autumn 2019 25 / 43

Page 26: PhD Macroeconomics 1: 1. Difference Equations and ...Second Order Di erence Equations: 1 Consider the following second-order equation y t + a 1y t 1 + a 2y t 2 = c The constant solution

Cycles From a Log-Linear Trend Model

Karl Whelan (UCD) Difference Equations and Time Series Autumn 2019 26 / 43

Page 27: PhD Macroeconomics 1: 1. Difference Equations and ...Second Order Di erence Equations: 1 Consider the following second-order equation y t + a 1y t 1 + a 2y t 2 = c The constant solution

Potential Problems: A Stochastic Trend Model

Drawing straight lines to detrend series can provide misleading results. Forexample, suppose the correct model is

yt = g + yt−1 + εt

Growth has a constant component g and a random bit εt .

Cycles are just the accumulation of all the random shocks that have affected∆yt over time.

There is no tendency to revert to the trend: Expected growth rate is always gno matter what has happened in the past.

In this case ∆yt is stationary: First-differencing gets rid of the non-stationarystochastic trend component of the series.

In this example, if we fitted a log-linear trend line through the series, theremight appear to be a mean-reverting cyclical component but there is not.

So detrending times series is not generally as simple as drawing a straight line.

Karl Whelan (UCD) Difference Equations and Time Series Autumn 2019 27 / 43

Page 28: PhD Macroeconomics 1: 1. Difference Equations and ...Second Order Di erence Equations: 1 Consider the following second-order equation y t + a 1y t 1 + a 2y t 2 = c The constant solution

Variations in Trend Growth: The Hodrick-Prescott Filter

A more realistic model should be one in which we accept that growth rate ofthe trend probably varies a bit over time leaving a cycle that moves up anddown over time.

Hodrick and Prescott (1981) suggested choosing the time-varying trend Y ∗t so

as to minimizeN∑t=1

[(Yt − Y ∗

t )2 + λ(∆Y ∗

t −∆Y ∗t−1

)]This method tries to minimize the sum of squared deviations between outputand its trend (Yt − Y ∗

t )2 but also contains a term that emphasises minimizingthe change in the trend growth rate (λ

(∆Y ∗

t −∆Y ∗t−1

)).

How do we choose λ and thus weight the goodness-of-fit of the trend versussmoothness of the trend?

λ = 1600 is the standard value used in business cycle detrending. We willdiscuss this choice in more detail in a few weeks.

Many DSGE modellers apply a HP filter to their data and then analyse onlythe cyclical components.

Karl Whelan (UCD) Difference Equations and Time Series Autumn 2019 28 / 43

Page 29: PhD Macroeconomics 1: 1. Difference Equations and ...Second Order Di erence Equations: 1 Consider the following second-order equation y t + a 1y t 1 + a 2y t 2 = c The constant solution

HP-Filtered Cycles Correspond Well to NBER Recessions

Karl Whelan (UCD) Difference Equations and Time Series Autumn 2019 29 / 43

Page 30: PhD Macroeconomics 1: 1. Difference Equations and ...Second Order Di erence Equations: 1 Consider the following second-order equation y t + a 1y t 1 + a 2y t 2 = c The constant solution

Investment Cycles Are Bigger than Consumption Cycles

Karl Whelan (UCD) Difference Equations and Time Series Autumn 2019 30 / 43

Page 31: PhD Macroeconomics 1: 1. Difference Equations and ...Second Order Di erence Equations: 1 Consider the following second-order equation y t + a 1y t 1 + a 2y t 2 = c The constant solution

The AR(1) Model and Impulse ResponsesCyclical components are positively autocorrelated (i.e. positively correlatedwith their own lagged values). and also exhibit random-looking fluctuations.

One simple model that captures these features is the AR(1) model(Auto-Regressive of order 1):

yt = ρyt−1 + εt

Suppose an AR(1) series starts out at zero. Then there is a unit shock, εt = 1and then all shocks are zero afterwards.

Period t, we have yt = 1, period t + 1, we have yt+1 = ρ, period t + n, wehave yt+n = ρn and so on.

The shock fades away gradually. How fast depends on the size of ρ. The timepath of y after this hypothetical shock is known as the Impulse ResponseFunction.

Can think of this as the path followed from t onwards when shocks are(εt + 1, εt+1, εt+2, .....) instead of (εt , εt+1, εt+2, .....), i.e. the incrementaleffect in all future periods of a unit shock today.

IRF graphs are commonly used to illustrate dynamic properties of macro data.

Karl Whelan (UCD) Difference Equations and Time Series Autumn 2019 31 / 43

Page 32: PhD Macroeconomics 1: 1. Difference Equations and ...Second Order Di erence Equations: 1 Consider the following second-order equation y t + a 1y t 1 + a 2y t 2 = c The constant solution

Volatility: Shocks and Propagation Mechanisms

Consider the AR(1) modelyt = ρyt−1 + εt

Suppose the variance of εt is σ2ε .

The long run variance of yt is the same as the long-run variance of yt−1 and(remembering that εt is independent of yt−1) this is given by

σ2y = ρ2σ2

y + σ2ε

Simplifies to σ2y =

σ2ε

1−ρ2

The variance of output depends positively on both shock variance σ2ε and also

on the persistence parameter ρ.

So the volatility of the series is partly due to size of shocks but also due to thestrength of the propagation mechanism.

Karl Whelan (UCD) Difference Equations and Time Series Autumn 2019 32 / 43

Page 33: PhD Macroeconomics 1: 1. Difference Equations and ...Second Order Di erence Equations: 1 Consider the following second-order equation y t + a 1y t 1 + a 2y t 2 = c The constant solution

Example: The Great Moderation

An interesting pattern: Output and inflation became substantially less volatileafter the mid-1980s. This was widely dubbed “The Great Moderation”

This pattern occurred in all the world’s major economies.

What was the explanation?

Smaller shocks? (Smaller values of εt)

1 Less random policy shocks?2 Smaller shocks from goods markets or financial markets?3 Smaller supply shocks?

Weaker propagation mechanisms? (Smaller values of ρ)

1 Did policy become more stabilizing?2 Did the economy become more stable, e.g. better inventory

management, increased share of services?3 Some had thought that financial modernization had stabilized the

economy. Less clear now!

Does the 2008-2009 global recession and subsequent slow recovery spell theend for the Great Moderation?

Karl Whelan (UCD) Difference Equations and Time Series Autumn 2019 33 / 43

Page 34: PhD Macroeconomics 1: 1. Difference Equations and ...Second Order Di erence Equations: 1 Consider the following second-order equation y t + a 1y t 1 + a 2y t 2 = c The constant solution

Less Extreme Movements in Output Growth and Inflation

Karl Whelan (UCD) Difference Equations and Time Series Autumn 2019 34 / 43

Page 35: PhD Macroeconomics 1: 1. Difference Equations and ...Second Order Di erence Equations: 1 Consider the following second-order equation y t + a 1y t 1 + a 2y t 2 = c The constant solution

The Great Moderation: Substantial Reductions in Volatility

Karl Whelan (UCD) Difference Equations and Time Series Autumn 2019 35 / 43

Page 36: PhD Macroeconomics 1: 1. Difference Equations and ...Second Order Di erence Equations: 1 Consider the following second-order equation y t + a 1y t 1 + a 2y t 2 = c The constant solution

More Complex Dynamics: The AR(2) Model

Not all impulse response functions just erode gradually of time as in theAR(1) model.

Macroeconomic dynamics can often be far more complicated.

Consider the AR(2) model:

yt = α + ρ1yt−1 + ρ2yt−2 + εt

This type of model can generate various types of impulse response functionssuch as oscillating or hump-shaped responses.

AR(3) and higher models can generate even more complex responses.

Lesson: The dynamic properties of your model will depend upon how manylags you allow.

Practitioners constructing empirical models often run battery of lag selectiontests to decide upon the appropriate lag length.

Karl Whelan (UCD) Difference Equations and Time Series Autumn 2019 36 / 43

Page 37: PhD Macroeconomics 1: 1. Difference Equations and ...Second Order Di erence Equations: 1 Consider the following second-order equation y t + a 1y t 1 + a 2y t 2 = c The constant solution

Two Examples of AR(2) Impulse Responses

r1=0.6,r2=0.3 r1=1.5,r2=-0.6

5 10 15 20-0.25

0.00

0.25

0.50

0.75

1.00

1.25

1.50

1.75

Karl Whelan (UCD) Difference Equations and Time Series Autumn 2019 37 / 43

Page 38: PhD Macroeconomics 1: 1. Difference Equations and ...Second Order Di erence Equations: 1 Consider the following second-order equation y t + a 1y t 1 + a 2y t 2 = c The constant solution

Consumption Dynamics Seem to be AR(1)

Karl Whelan (UCD) Difference Equations and Time Series Autumn 2019 38 / 43

Page 39: PhD Macroeconomics 1: 1. Difference Equations and ...Second Order Di erence Equations: 1 Consider the following second-order equation y t + a 1y t 1 + a 2y t 2 = c The constant solution

Output AR(2) Model Shows A Small Humped-Shape IRF

Karl Whelan (UCD) Difference Equations and Time Series Autumn 2019 39 / 43

Page 40: PhD Macroeconomics 1: 1. Difference Equations and ...Second Order Di erence Equations: 1 Consider the following second-order equation y t + a 1y t 1 + a 2y t 2 = c The constant solution

Lag Operators and Lag Polynomials

The lag operator is a useful piece of terminology that is sometimes used intime series modelling. The idea is to use an “operator” to move the seriesback in time, e.g. Lyt = yt−1 and L2yt = yt−2.

Sometimes economists will specify a model that has a bunch of lags using apolynominal in lag operators e.g. the model

yt = a1yt−1 + a2yt−2 + εt

can be written asyt = A(L)yt + εt

whereA(L) = a1L + a2L

2

Alternatively, you could write

B(L)yt = εt

where B(L) = 1− a1L− a2L2.

Karl Whelan (UCD) Difference Equations and Time Series Autumn 2019 40 / 43

Page 41: PhD Macroeconomics 1: 1. Difference Equations and ...Second Order Di erence Equations: 1 Consider the following second-order equation y t + a 1y t 1 + a 2y t 2 = c The constant solution

Vector Autoregressions

AR models are a very useful tool for understanding the dynamics of individualvariables.

But they ignore the interrelationships between variables.

Vector Autoregressions (VARs) model the dynamics of n different variables,allowing each variable to depend on lagged values of all of the variables.

Can examine impulse responses of all n variables to all n shocks.

Simplest example is two variables and one lag:

y1t = a11y1,t−1 + a12y2,t−1 + e1t

y2t = a21y1,t−1 + a22y2,t−1 + e2t

Invented by Chris Sims (1980). Now used as a central tool in appliedmacroeconomics.

Karl Whelan (UCD) Difference Equations and Time Series Autumn 2019 41 / 43

Page 42: PhD Macroeconomics 1: 1. Difference Equations and ...Second Order Di erence Equations: 1 Consider the following second-order equation y t + a 1y t 1 + a 2y t 2 = c The constant solution

What Are These Shocks?

Macroeconomists now spend a lot of time examining the shocks in VAR modelsand their effects. But what are the shocks? Lots of possibilities:

1 Policy changes not due to the systematic component of policy captured by theVAR equation.

2 Changes in preferences, such as attitudes to consumption versus saving orwork versus leisure.

3 Technology shocks: Random increases or decreases in the efficiency withwhich firms produce goods and services.

4 Shocks to various frictions: Increases or decreases in the efficiency with whichvarious markets operate, such as the labour market, goods markets, orfinancial markets.

Karl Whelan (UCD) Difference Equations and Time Series Autumn 2019 42 / 43

Page 43: PhD Macroeconomics 1: 1. Difference Equations and ...Second Order Di erence Equations: 1 Consider the following second-order equation y t + a 1y t 1 + a 2y t 2 = c The constant solution

Time Series as a Framework for Empirical Macro

The time series perspective—cycles being determined by various randomshocks which are propagated throughout the economy over time—is central tohow modern macroeconomists now view economic fluctuations.

VARs are a very common framework for modelling macroeconomic dynamicsand the effects of shocks.

But while VARs can describe how things work, they cannot explain whythings work that way.

To have real confidence in a description of how the economy works, we ideallywant to know how people in the economy behave and why they they behavethat way.

That’s where economic theory comes in.

DSGE models aim to have the dynamic structure of VARs (shocks andpropagation mechanisms, IRFs) but are derived from economic theory inwhich all agents are rational and optimizing.

Karl Whelan (UCD) Difference Equations and Time Series Autumn 2019 43 / 43