environment): possible to convert original problem into one with quadratic return ... do so by taking the optimal growth
Methods and Applications in Quantitative Macroeconomics PhD course, Vienna University of Economics and Business, Block 1
Katrin Rabitsch Vienna University of Economics and Business
October 2017
Block (1)
Quant. Macro
October 2017
1 / 159
Motivation and aim of the course to provide techniques for analysis and evaluation of modern macro models, i.e. Dynamic Stochastic General Equilibrium (DSGE) models why study DSGE models: that’s what macro is all about: DSGE models dominate all …elds of macro: Real Business Cylces, New Keynesian/ Monetary Economics, (Macro-)Labor, Open Economy Macro, Fiscal Policy, Models of …nancial frictions, Macroprudential Policy, Heterogenous Agents, ... powerful ways of evaluating macroeconomic theories, macroeconomic policy, welfare consequences,... quantitative: way to evaluate empirical plausibility of theory
Block (1)
Quant. Macro
October 2017
2 / 159
Motivation and aim of the course
course focuses on understanding macroeconomic ‡uctuations (the business cycle) …rst, get an overview of the stylized facts of the data: how volatile are GDP, consumption, investment, employment, etc. over the business cycle how does, e.g., consumption or employment comove with output
construct and evaluate macroeconomic model in which the behavior of model variables correspond closely to its empirical counterpart/ the variable in the data what is the nature of business cycles? what is the role of economic policy?
Block (1)
Quant. Macro
October 2017
3 / 159
Motivation and aim of the course misunderstandings: a model is implausible or a false description of the data there always are dimensions along which any model is unrealistic there always is some variable which is not explained well
implausible since lots of frictions and imperfections in actual economies
=) build models that include key features/ frictions necessary for the question you want to address build models that are consistent with key aspects (calibration)
Block (1)
Quant. Macro
October 2017
4 / 159
Motivation and aim of the course
Goals of this course get familiar with the most important and most frequently used methods to solve and analyze DSGE models get equipped with the skills necessary to apply these methods on example models on a computer (Matlab) course takes an applied approach: when a new method is introduced, will do so in the simplest framework possible (e.g. often the stochastic growth model) once method has been learned, apply it to richer (and arguably much more interesting) model economies
Block (1)
Quant. Macro
October 2017
5 / 159
Aim and overview of the course How to solve DSGE models?
DSGE models typically: are highly nonlinear involve expectations no closed form solutions many approaches to solve.. we distinguish between: local approximation methods global (approximation) methods
Block (1)
Quant. Macro
October 2017
6 / 159
Aim and overview of the course Local approximation methods
(Log-) Linearizaton/ 1st oder approximations: solved via the method of undetermined coe¢ cients/ with standard matrix algebra easy and fast
2nd (or higher) order approximations: almost as easy as linearization and quite fast
(optimal linear regulator: in some occasions (in a frictionless environment): possible to convert original problem into one with quadratic return function and linear constraints)
Block (1)
Quant. Macro
October 2017
7 / 159
Aim and overview of the course Local approximation methods
advantages: easy to apply and not computationally intensive can be applied to models with a multitude of state variables disadvantages: local approximations not appropriate for saying something about global properties of a model (far from approximation point) Linearization (1st order perturbation) methods introduce certainty equivalence (uncertainty does not a¤ect the decision rules)
Block (1)
Quant. Macro
October 2017
8 / 159
Aim and overview of the course Global (approximation) methods
can work on the value function, policy functions, parameterize expectations, ... can use iterative versus simulation methods ... can use discrete state space methods, can use projection methods ...
Block (1)
Quant. Macro
October 2017
9 / 159
Aim and overview of the course Global (approximation) methods
advantages: powerful and precise numerical approaches can be used in models with inequality constraints disadvantages: curse of dimensionality problem: hard to apply in models with many endogenous state variables can become extremely (prohibitively) slow
Block (1)
Quant. Macro
October 2017
10 / 159
Linear (1st order) approximations
we start by having a …rst look at solving linear (rational expectations) models take 1st order approximations, (log-)linearize solve resulting system of linear di¤erence equations
do so by taking the optimal growth (Ramsey) model as an example this (the Ramsey growth model) will build up (adding uncertainty and endogenous labor choice) to our …rst model of explaining macroeconomic ‡uctuations: the Real Business Cycle (RBC) model
Block (1)
Quant. Macro
October 2017
11 / 159
Motivation for the RBC model can distinguish: theories and models that attempt to understand the determinants of long-run economic growth (increases in national income). theories that aim to understand the causes and consequences of short-run ‡uctuations in national income (the business cycle). We discuss two aspects of macroeconomic ‡uctuations/ business cycles in this course: 1
"characterization" of BC: measurement of business cycles, descriptive; what do the data tell us about cycles?
2
"modelling" of BC: the state of the art tools for business cycle analysis are Dynamic Stochastic General Equilibrium (DSGE) models
Block (1)
Quant. Macro
October 2017
12 / 159
Motivation Economy displays considerable short-run ‡uctuations around the long-term growth rate: Business Cycle (BC) these ‡uctuations or cycles are economy wide, not industry or sector speci…c factors of growth (population growth, technological progress) largely viewed as unrelated to the factors that determine ‡uctuations in the short run: "dychotomous view" in the data typically …nd unit root of log GDP: in the traditional view the log GDP can be written as yt = ytT + ytc , with ytT being a trend component, ytc being a cyclical component, and with the understanding that the components ytc is stationary (shocks are only temporary)
Block (1)
Quant. Macro
October 2017
13 / 159
Economic ‡uctuation do not underly simple repeating patterns. Recessions occur with very di¤erent intensities and time durations. The average cycle length is 5-8 years. Because of the seemingly stochastic nature of the time series, modern business cycle theory assumes that unexpected shocks hit the economy, which then propagate throughout the system.
Block (1)
Quant. Macro
October 2017
14 / 159
Trend versus Cycle Consider the time series of log GDP, fyt g:
Source: Stock and Watson (1999)
To look at the cycle, need to eliminate the long term trend, that is, we need to detrend the series! Block (1)
Quant. Macro
October 2017
15 / 159
Consider an economic time series yt for t = 1, 2, ...T Several ways to eliminate the non-stationary component: 1
deterministic detrending
2
First di¤erencing
3
Approximate Bandpass Filter
4
Hodrick-Prescott Filter
Block (1)
Quant. Macro
October 2017
16 / 159
deterministic detrending: yt trend component: cyclical component:
= ytT + ytC ytT = α + βt (or ytT = α + βt + γt 2 ) ytC = yt ybtT (residual)
Source: Stock and Watson (1999)
Block (1)
Quant. Macro
October 2017
17 / 159
First di¤erencing: ytC = ∆yt
Source: Stock and Watson (1999)
Block (1)
Quant. Macro
October 2017
18 / 159
Alternatively, we can get a more ‡exible deterministic trend which is not simply a time trend (or a quadratic time trend) by using a …lter on the logged time series.
Block (1)
Quant. Macro
October 2017
19 / 159
Approximate Bandpass Filter (Baxter and King, REStat 1999): This …lter was designed to isolate ‡uctuations in the data which persist for periods of about two through eight years. Filter eliminates very slow moving ("trend") components and very high frequency ("irregular ") components, while retaining intermediate ("business cycle") components This …lter also ’detrends’the data, in the sense that it will render time series that are integrated of order two or less stationary, or that contain deterministic time trends. trend component: period of more than 32 quarters
Block (1)
Quant. Macro
October 2017
20 / 159
business cycle component: range of 6 to 32 quarters, which comes from the empirical observation that most cycles in the US have lasted somewhere about that time.
irregular component: corresponds to periodicities of less than 6 quarters
Block (1)
Quant. Macro
October 2017
21 / 159
Hodrick-Prescott (HP) Filter: Alternatively, one can apply the HP …lter to obtain a smoothed non-linear representation of a time series, one that is more sensitive to long-term than to short-term ‡uctuations. The adjustment of the sensitivity of the trend to short-term ‡uctuations is achieved by modifying a multiplier λ. With yt = ytT + ytC , the …lter equation is given by: T
min ∑ yt t =1
Block (1)
ytT
2
T
+λ
1h
∑
ytT+1
t =2
Quant. Macro
ytT
ytT
ytT
1
i2
October 2017
22 / 159
The …rst term of the equation is the sum of the squared deviations which penalizes the cyclical component. The second term is a multiple λ of the sum of the squares of the trend component’s second di¤erences. This second term penalizes variations in the growth rate of the trend component. The larger the value of λ, the higher is the penalty. The choice of λ depends on the data frequency. Hodrick and Prescott advise that, for (U.S.) quarterly data, a value of λ = 1600 is reasonable. further characteristics of HP-…lter (Kydland and Prescott 1990)
Block (1)
Quant. Macro
October 2017
23 / 159
Statistical Characterization of Business Cycles
For any economic variable we can derive a number of interesting measures of the cyclical component of that variable that summarize key features of its business cycle properties. Typically, we look at the moments of the logged and …ltered time series. In particular, we look at the properties of a time series in terms of its: 1
amplitude or volatility: absolute or relative
2
comovement: with other variables or with itself at di¤erent time lags/leads
Block (1)
Quant. Macro
October 2017
24 / 159
Statistical Characterization of Business Cycles
amplitude or volatility: standard deviation σ xtC relative standard deviation σ xtC σ ytC
Block (1)
Quant. Macro
October 2017
25 / 159
Statistical Characterization of Business Cycles comovement: comovement with GDP or with another variable of interest, static or dynamic cross correlations: ρ xtC , ytC+k
for k = 0,
1,
2...
special case: k = 0: contemporaneous correlation: ρ > 0 ... procyclical ρ < 0 ... countercyclical ρ
Block (1)
0 ... acyclical (no clear cyclical behavior)
Quant. Macro
October 2017
26 / 159
Statistical Characterization of Business Cycles if highest correlation appears in k = 0 =) coincident variable. Similarly, a lagged variable has the highest correlation in a period in the past and a leading variable has the highest correlation in a period in the future: (k max < 0) coincident (k max < 0) lagging (k max > 0) leading persistence: measures of correlation between GDP in period t and GDP in period t k: autocorrelation
Block (1)
Quant. Macro
October 2017
27 / 159
Statistical Properties of Business Cycles
The Real Business Cycle literature focuses on the statistical properties of real variables. First, let’s have a …rst look at the data and let’s summarize what we can typically …nd: derive some stylized facts.
Block (1)
Quant. Macro
October 2017
28 / 159
Cyclical Behavior of Major Macro Variables
Source: King and Rebelo (1999) Block (1)
Quant. Macro
October 2017
29 / 159
Cyclical Behavior of Major Macro Variables
Source: King and Rebelo (1999)
Block (1)
Quant. Macro
October 2017
30 / 159
Cyclical Behavior of Major Macro Variables
Source: King and Rebelo (1999) Block (1)
Quant. Macro
October 2017
31 / 159
Cyclical Behavior of Major Macro Variables
Source: King and Rebelo (1999)
Block (1)
Quant. Macro
October 2017
32 / 159
Cyclical Behavior of Major Macro Variables
Source: King and Rebelo (1999) Block (1)
Quant. Macro
October 2017
33 / 159
Cyclical Behavior of Major Macro Variables
Source: King and Rebelo (1999) Block (1)
Quant. Macro
October 2017
34 / 159
Cyclical Behavior of Major Macro Variables
Block (1)
Source: King and Rebelo (1999) Quant. Macro
October 2017
35 / 159
A further look at the data (US quarterly data, Bandpass)
Block (1)
Quant. Source: Stock andMacro Watson (1999)
October 2017
36 / 159
Source: Stock and Watson (1999)
Block (1)
Quant. Macro
October 2017
37 / 159
Statistical Properties of Business Cycles
output/GDP (y ), consumption (c), investment (i): σ (c ) < σ (y ) < σ (i ) consumption (9.) is smoother than output: σ (c ) 1.26 = = 0.76 σ (y ) 1.66 investment (14.) is much more volatile than output: σ (i ) 4.97 = = 2.99 σ (y ) 1.66
Block (1)
Quant. Macro
October 2017
38 / 159
Statistical Properties of Business Cycles
both c and i are highly procyclical (positive contemporanous correlation with output): consumption (9.): ρ (ct , yt ) = 0.90 investment (14.): ρ (it , yt ) = 0.89
Block (1)
Quant. Macro
October 2017
39 / 159
Statistical Properties of Business Cycles
total hours worked (H), employment (N) σ (H ) ' σ (y ) total hours (26.) are about as volatile as output: σ (H ) 1.61 = = 0.97 σ (y ) 1.66 total employment (25.) is somewhat less volatile: σ (N ) 1.39 = = 0.84 σ (y ) 1.66
Block (1)
Quant. Macro
October 2017
40 / 159
Statistical Properties of Business Cycles Note that total hours can be decomposed into an extensive measure and an intensive measure of the labor market: H
=
H N | {z intensive margin
}
|
N {z
extensive
}
margin
both H and N very procyclical: Hours (26.): ρ (Ht , yt ) = 0.88 Employment (25.): ρ (Nt , yt ) = 0.81
Block (1)
Quant. Macro
October 2017
41 / 159
Source: Stock and Watson (1999)
Block (1)
Quant. Macro
October 2017
42 / 159
Source: Stock and Watson (1999)
Block (1)
Quant. Macro
October 2017
43 / 159
Statistical Properties of Business Cycles
total factor productivity (a) assume have a Cobb-Douglas (CRS) production function, Y = AK α N 1 α . Taking logs we can derive log total factor productivity as: at = yt αkt (1 α) nt where yt , kt , and nt are observed in the data. We …nd that total factor productivity, TFP, (32.) does not appear to be very smooth, but displays strong variations in the short run. RBC theory: TFP as the driving source of variations of output in the short run. TFP leads income: on average an increase in TFP tends to lead to an increase in output (but does not necessary imply causality)
Block (1)
Quant. Macro
October 2017
44 / 159
Statistical Properties of Business Cycles average labor productivity (X =
Y H
or X =
Y N)
found to be procyclical (33.)... puzzle. why?: Think of that most production functions display decreasing returns to labor. E.g., with a Cobb-Douglas production function, Y = AK α N 1 α , we have that: Y = AK α N N
α
from which we would think that X = Y N and N are inversely related. Capital (K ) does not display much variations in the short-run ! thus most of the short-run output variations should be explained by labor... which according to a decreasing returns production function should be countercylical. The fact that we …nd labor productivity to be procyclical in the data has led to the view that short-run variations in technology are a major source of output variations in the short-run: an argument at the center of the RBC theory Block (1)
Quant. Macro
October 2017
45 / 159
Statistical Properties of Business Cycles
Y = |{z} A K α |{z} N α N |{z} "
*
#
the negative e¤ect on labor productivity from an in increase in labor is more than o¤set by increases in technology =) thus we can observe that both labor increases / the marginal product of labor decreases and nevertheless labor productivity increases
Block (1)
Quant. Macro
October 2017
46 / 159
Statistical Properties of Business Cycles
Note: under the additional assumption of perfect competition, we …nd:
(1 where (1
α) =
dY N dN Y
α) is the labor income share. Similarly, α=
dY K dK Y
where α is the capital income share.
Block (1)
Quant. Macro
October 2017
47 / 159
Statistical Properties of Business Cycles
real wage (w ), real wage (44.) is: much less volatile than output slightly procyclical or acyclical
real interest rate (r ) real interest rate (50.) is: much less volatile than output slightly countercyclical
Block (1)
Quant. Macro
October 2017
48 / 159
Statistical Properties of Business Cycles
So far we have seen business cycle stylized facts for the U.S. economy. What about other countries?
Block (1)
Quant. Macro
October 2017
49 / 159
Business Cycle Stylized Facts for Developed Countries
Block (1)
Quant. Backus, Kehoe andMacro Kydland (1995)
October 2017
50 / 159
Business Cycle Stylized Facts for Developed Countries
across (developed) countries, we …nd a similar set of stylized facts: consumption typically less volatile than output, investment typically much more volatile (2-3 times) than output consumption and investment highly procyclical net exports typically countercyclical employment procyclical productivity highly procyclical
Block (1)
Quant. Macro
October 2017
51 / 159
What about the International Business Cycle?
Block (1)
Quant. Backus, Kehoe andMacro Kydland (1995)
October 2017
52 / 159
What about the International Business Cycle?
Is the business cycle of one country connected to another country’s business cycle?: international outputs tend to have positive comovement relatively high comovement for countries with which the U.S. economy is linked (Canada, UK) Japan, Germany tend to lag U.S. output
Block (1)
Quant. Macro
October 2017
53 / 159
Business Cycle Stylized Facts of the Euro Area
Source: Agresti and Mojon (2001) Block (1)
Quant. Macro
October 2017
54 / 159
Business Cycle Stylized Facts for emerging economies
Block (1)
Source: Aguiar and Gopinath (2004) Quant. Macro
October 2017
55 / 159
Business Cycle Stylized Facts for emerging economies
Source: Aguiar and Gopinath (2004)
Block (1)
Quant. Macro
October 2017
56 / 159
Business Cycle Stylized Facts for emerging economies
Source: Aguiar and Gopinath (2004)
Block (1)
Quant. Macro
October 2017
57 / 159
Business Cycle Stylized Facts for emerging economies
Source: Aguiar and Gopinath (2004)
Block (1)
Quant. Macro
October 2017
58 / 159
Business Cycle Stylized Facts for emerging economies
Source: Aguiar and Gopinath (2004)
Block (1)
Quant. Macro
October 2017
59 / 159
Business Cycle Stylized Facts for emerging economies
Source: Aguiar and Gopinath (2004)
Block (1)
Quant. Macro
October 2017
60 / 159
Business Cycle Stylized Facts for emerging economies
emerging market economies typically have more volatile output relative to advanced economies substantially more volatile consumption, typically σ (c ) >1 σ (y ) the trade balance is much more volatile compared to developed economies the trade balance is very countercyclical
Block (1)
Quant. Macro
October 2017
61 / 159
Business Cycle Stylized Facts for emerging economies
Block (1)
Quant. Macro
October 2017
62 / 159
Business Cycle Stylized Facts for Central & Eastern Europe
Source: Benczur and Ratfai (2005) Block (1)
Quant. Macro
October 2017
63 / 159
Business Cycle Stylized Facts for Central & Eastern Europe
Source: Benczur and Ratfai (2005)
Block (1)
Quant. Macro
October 2017
64 / 159
Business Cycle Stylized Facts for Central & Eastern Europe
Source: Benczur and Ratfai (2005)
Block (1)
Quant. Macro
October 2017
65 / 159
Business Cycle Stylized Facts for Central & Eastern Europe
Source: Benczur and Ratfai (2005)
Block (1)
Quant. Macro
October 2017
66 / 159
Business Cycles, Changes over Time
Backus and Kehoe (AER 1992) use long term data to analyze the historical properties of business cycles: they consider 3 periods: prewar (before WWI), interwar (between WWI and WWII) and postwar (after WWII) economies were much more volatile in prewar and especially interwar period relative to postwar (only exeption: Japan) this seems to be a robust result even though data might exhibit measurement errors, changes in methodology,...
Block (1)
Quant. Macro
October 2017
67 / 159
Changes over Time
Block (1)
Quant. Macro
October 2017
68 / 159
Changes over Time
Stock and Watson (2000) focus more speci…cally on the postwar period:
volatility of GDP
1960-69 0.98
1970-79 1.18
1980-89 1.14
1990-2001 0.67
similarly for many other economic time series (consumption, investment, exports, imports, nonagricultural employment, price in‡ation, T-bill-rates,...)
) "vanishing of the business cycle" or "Great Moderation"
Block (1)
Quant. Macro
October 2017
69 / 159
Changes over Time, "vanishing of the business cycle" When did it change?: some point early in the mid-1980s Possible hypothesis that could explain the vanishing of the business cycle:
changes in output composition: more and more output is allocated to services (services much less volatile than manufacturing) Stock and Watson "eliminated" change in composition (i.e., held shares of manufacturing and service sector to output constant): the "vanishing" of the business cylce still there
policy improvements ("Good Policy"): governments/ monetary authorities may have become more successful in stabilizing the economy
Block (1)
Quant. Macro
October 2017
70 / 159
Changes over Time, "vanishing of the business cycle" size of shocks ("Good Luck"): shocks smaller than in the past? Take: yt = ρyt 1 + εt then the variance of output is var (yt ) =
var (εt ) 1 ρ2
to what sense is the decrease in the variance of yt attributable to a decrease in the variance of the shock (var (εt )) and to what sense to a change in the persistence of the shock (i.e., ρ): mostly because of changes in the variance of the shocks
While there is still discussion on sources of the "great moderation", the onset of the current economic crisis in 2008 appears to mark its end. Block (1)
Quant. Macro
October 2017
71 / 159
The RBC research programme Core idea: Agreement that ‡uctuations are caused by disturbances that hit the economy, but the schools of thought di¤er in the assumptions on the nature of these shocks and the propagation mechanism: the Real Business Cycle theory interprets economic ‡uctuations through the lens of the neoclassical growth model ‡uctuations are result of random ‡uctuations in productivity and the optimal response of economic agents to these ‡uctuations no need for money, ignores the monetary sector completely no externalities, no asymmetric information, no market failure, no missing markets no nominal rigidities nor other imperfections. heterogeneity of households not considered important ! all households and …rms are assumed to be identical (representative agents).
Block (1)
Quant. Macro
October 2017
72 / 159
though many of the above features don’t sound appealing/ realistic, RBC model performs surprisingly well at matching the data de…nitely makes sense to study the RBC model as ’a …rst model of macroeconomic ‡uctuations’ we actually look at an even simpler model …rst: the optimal growth model, also known as the Ramsey-Cass-Koopmans model
Block (1)
Quant. Macro
October 2017
73 / 159
Optimal growth model (Ramsey model) for now: assume certainty abstract from population growth or technological progress (these are easy to reinstate) single representative conusmer with preferences: ∞
U=
∑ β t u ( ct )
(1)
t =0
subject to resource and non-negativity constraints (for all t): ct + kt +1 ct , kt +1
f (kt ) + (1
δ) kt
(2)
0 k0 given
Block (1)
Quant. Macro
(3) October 2017
74 / 159
Review: Static Optimization (with equality constraints)
Source: Simon and Blume (1994)
Block (1)
Quant. Macro
October 2017
75 / 159
Optimal growth model
set up sequence formulation of the problem of a benevolent social planner both consumption and production decisions are made by same economic agent could alternatively solve competitive equilibrium ∞
L=
∑ βt fu (ct ) + λt [f (kt ) + (1
δ) kt
ct
kt +1 ]g
(4)
t =0
(alternatively could have solved the dynamic programming problem: could have exhausted recursive structure, de…ned the value funtion v (k ) and set up Bellmann equation; will do that later)
Block (1)
Quant. Macro
October 2017
76 / 159
Optimal growth model what does agent optimize w.r.t.? current consumption, ct ’tomorrow’s’capital stock, kt +1 (notation: kt denotes the capital stock that the agent decided on at time t 1 and that is carried over into period t !) the Lagrange multiplier λt
to best see how to take the derivative w.r.t. kt +1 rewrite the Lagrangian and decompose the in…nite sum (with t = 0): 2
3 βt fu (ct ) + λt [f (kt ) + (1 δ) kt kt +1 ct ]g 6 + βt +1 fu (ct +1 ) + λt +1 [f (kt +1 ) + (1 δ) kt +1 kt +2 ct +1 ]g 7 7 L=6 4 + βt +2 fu (ct +2 ) + λt +2 [f (kt +2 ) + (1 δ) kt +2 kt +3 ct +2 ]g 5 +... Block (1)
Quant. Macro
October 2017
77 / 159
Optimal growth model FOC w.r.t. ct : u 0 ( ct ) = λ t
(5)
FOC w.r.t. kt +1 : λt = βλt +1 f 0 (kt +1 ) + (1
δ)
(6)
δ) kt
(7)
FOC w.r.t. λt : kt +1 + ct = f (kt ) + (1 Transversality condition: lim
t !∞
Block (1)
βt u 0 (ct ) kt +1 = 0
Quant. Macro
(8)
October 2017
78 / 159
Optimal growth model
above …rst order conditions can be combined to get the familiar optimality conditions for the growth model, that is, a di¤erence equation for consumption: the Euler equation, from combining FOCs w.r.t. ct and w.r.t. kt +1 the resource constraint plus an initial and a terminal condition (the transversality condition, TVC):
Block (1)
Quant. Macro
October 2017
79 / 159
Optimal growth model
the optimal growth model reduces to a system of nonlinear di¤erence equations in ct and kt , with two boundary conditions: the given initial condition k0 and the TVC
u 0 (ct ) = βu 0 (ct +1 ) f 0 (kt +1 ) + (1 kt +1 + ct with lim
t !∞
Block (1)
t 0
β u (ct ) kt +1
δ)
(9)
= f (kt ) + (1 δ) kt = 0 and k0 given
Quant. Macro
October 2017
80 / 159
Optimal growth model
don’t know how to solve this nonlinear system but do know how to solve a linear system of di¤erence equations
=) take a (log-) linear approximation of the above system around the deterministic steady state
Block (1)
Quant. Macro
October 2017
81 / 159
Log-linearization of optimal growth model Steady State
the steady state is given by c = ct = ct +1 and k = kt = kt +1 : δ+f0 k
1 = β 1 k +c
= f k + (1
δ) k
with Cobb-Douglas production function f (k ) = k α steady state consumption and capital stock are pinned down as: k
=
c
= k
α ρ+δ α
1 1 α
δk
where ρ is the discount rate, related to discount factor β by β = 1/ (1 + ρ) . Block (1)
Quant. Macro
October 2017
82 / 159
Log-linearization of optimal growth model Brief review of (log-)linearization
recall formula for 1st order Taylor expansions for a function of a single variable vt : f (vt ) ' f (v ) + f 0 (v ) (vt
v)
for a function of several variables ut and vt f (ut , vt ) ' f (u, v ) + fu (u, v ) (ut
Block (1)
Quant. Macro
u ) + fv (u, v ) (vt
October 2017
v)
83 / 159
Log-linearization of optimal growth model Brief review of (log-)linearization
de…ne log-deviations of a variable from its steady state value (a variable is at steady state if its log-deviation is zero) b xt
log
xt x
can rewrite any variable xt as: xt = x
xt xt = xe log ( x ) = xe xbt x
take a …rst order Taylor approximation, in terms of ’hat’-variables, around the steady state, i.e. around b xt = 0 Block (1)
f (xt ) ' f xe 0 + f 0 xe 0 x (b xt Quant. Macro
0)
October 2017
84 / 159
Log-linearization of optimal growth model
log-linearize the system of nonlinear di¤erence of the optimal growth model: rewrite in terms of ’transformed’variables: h = βu 0 ce cbt +1 1 u 0 ce cbt b
ce cbt + ke kt +1
b
= f ke kt + (1
b
δ + f 0 ke kt +1 b
δ) ke kt
i
linearize around steady state, i.e. point where b ct = 0 , kbt = 0,..
Block (1)
Quant. Macro
October 2017
85 / 159
Log-linearization of optimal growth model log-linearize Euler equation: 8
> β 1 δ+f0 k > > > > | {z } > > > > > > =1 at st.st. > > > > 00 u c c ( ) > > 0 < = 00 k b c + β 1 δ + f u (c ) c u 0 (c ) t +1 | {z } 1+ 0 b ct = > > u (c ) =1 at st.st. > > > > f 00 (k )k > > 0 > > b > > k k βf t + 1 > > 0 k f ( ) > > | {z } > > : ; at st.st. =[1 β(1 δ)] 9 8 u 00 (c )c > > b c + ( ) = < t +1 u 0 (c ) u 00 (c ) c 00 b c = ( ) t f (k )k > u 0 (c ) kbt +1 > ; : [1 β (1 δ)] f 0 k ( ) Block (1)
Quant. Macro
October 2017
86 / 159
Log-linearization of optimal growth model
log-linearize resource constraint: c + k + cb ct + k kbt +1 =
c k b b ct + kt +1 = f k f k
Block (1)
"
f0
f k + (1 δ ) k + k k kbt + (1 δ) k kbt
f0 k k f k
Quant. Macro
kbt + (1
k b δ) kt f k
#
October 2017
87 / 159
Log-linearization of optimal growth model
summarizing:
u 00 (c ) c u 0 (c )
Block (1)
u 00 (c )c u 0 (c )
9 > =
ct + 1 ) + ( b 00 f (k )k > > kbt +1 ; : [1 β (1 δ)] f 0 k ( ) " # f0 k k k = kbt + (1 δ) kbt y y
ct ) = ( b
c k b ct + kbt +1 y y
8 >
1 =) as t ! ∞ a
t
!0
stable unstable
in stable case: whatever initial value x0 , converges to equilibrium. in unstable case: whatever initial value x0 , diverges from equilibrium (apart from case a = 1: always stay at x0 ; case a = 1: jumps between x0 and x0 )
Monotonicity or oscillation a
0
a < 0 Block (1)
monotone/ non-oscillatory oscillatory Quant. Macro
October 2017
103 / 159
Excursion: math primer on solving linear di¤erence equations
Source: Chiang (1984)
Note: parameter b in Chiang’s table corresponds to our parameter a on the previous slides.. Block (1)
Quant. Macro
October 2017
104 / 159
Excursion: math primer on solving linear di¤erence equations Divide range of possible values of (Chiang’s parameter) b (our a) into seven regions over domain ( ∞, ∞) :
Source: Chiang (1984)
Block (1)
Quant. Macro
October 2017
105 / 159
Excursion: math primer on solving systems of linear di¤erence equations say we have a 2-dimensional (homogenous) system of di¤erence equations (DE) which we can rewrite in matrix notation as: zt +1 Azt = 0
(19)
with A=
a11 a12 a21 a22
(where in our example of the growth model we have zt = A = W .)
system of DE could be
kbt b ct
and
uncoupled coupled Block (1)
Quant. Macro
October 2017
106 / 159
Excursion: math primer on solving systems of linear di¤erence equations Uncoupled system
uncoupled system: if A is diagonal of the form A =
a11 0 0 a22
no interaction between the 2 equations obvious solution: zt = At z0 , t a11 0 t 0 a22 the stability of the system depends on the behavior of each component
where At =
Block (1)
Quant. Macro
October 2017
107 / 159
Excursion: math primer on solving systems of linear di¤erence equations Uncoupled system
example: z1t +1 z2t +1
=
0.5 0 0 2
z1t z2t
solution: z1t z2t
= 0.5t z10 = 2t z20
system unstable because one component converges to 0 but the other explodes
Block (1)
Quant. Macro
October 2017
108 / 159
Excursion: math primer on solving systems of linear di¤erence equations Coupled system
coupled system: if A is not diagonal there is feedback between the two equations and we can no longer solve them independently; the system is coupled would be nice to be able to do a change of variable that allows us to ’uncouple’or ’diagonalize’the system
Block (1)
Quant. Macro
October 2017
109 / 159
Excursion: math primer on solving systems of linear di¤erence equations Coupled system
a square matrix A can be diagonalized if there exists an invertible matrix Q s.t. D = Q 1 AQ, where D is a diagonal matrix. Then: zt +1 Azt 1
Q Q zt +1 | {z } e zt +1
1
AQ Q zt | {z } e zt
Qe zt +1 AQe zt
e zt +1 Q
1
AQe zt
e zt +1 De zt
= 0 = 0 = 0 = 0 = 0
the solution to the transformed system would then be e zt = Dt e z0
can always recover original variable zt , from zt = Qe zt Block (1)
Quant. Macro
October 2017
110 / 159
Excursion: math primer on solving systems of linear di¤erence equations Coupled system
now know why matrices that can be diagonalized are useful how do we diagonalize?: can we always diagonalize? no, only if matrix A is well-behaved (having all distinct eigenvalues) …nd the eigenvalues of A and the associated eigenvectors if matrix A is a square matrix, a scalar λ is an eigenvalue of A if and only if A λI is singular that is, if det (A λI) = 0
Block (1)
Quant. Macro
October 2017
111 / 159
Excursion: math primer on solving systems of linear di¤erence equations Coupled system
for a 2x2 system: a11 λ a12 a21 a22 λ
det
(a11 λ2
λ) (a22
λ)
= 0
a12 a21 = 0
(a11 + a22 ) λ + (a11 a22
a12 a21 ) = 0
(20)
where equation (20) is the characteristic polynomial with solution:
p
b 2 4ac 2a with a = 1, b = (a11 + a22 ) , c = (a11 a22 λ1 , λ2 =
Block (1)
b
Quant. Macro
a12 a21 ) October 2017
112 / 159
Excursion: math primer on solving systems of linear di¤erence equations Coupled system
if λ is an eigenvalue of A, there must be at least one vector x 6= 0, called an eigenvector, such that Ax = λx, x 6= 0 recall: want to write matrix A in form AQ = QD A
q1 q2
=
q1 q2
λ1 0 0 λ2
so q1 and q2 are the eigenvectors corresponding to eigenvalues λ1 and λ2
Block (1)
Quant. Macro
October 2017
113 / 159
Excursion: math primer on solving systems of linear di¤erence equations Coupled system
what can we say about the properties of the diagonalizable matrix A easy to multiply A A =QDQ 1 QDQ 1 = QDDQ 1 = QD 2 Q 1 A A A = QD 3 Q 1 At = QD t Q 1
Block (1)
Quant. Macro
October 2017
114 / 159
Solving the (log-linearized) optimal growth model
this ends our short math review let’s return to our linear system of di¤erence equations from the optimal growth model: kbt +1 b ct + 1
=W
kbt b ct
(21)
for now, continue to assume that matrix A could be inverted to form W = A 1 B and that W is well-behaved
Block (1)
Quant. Macro
October 2017
115 / 159
Solving the (log-linearized) optimal growth model
now, use what we learned on diagonalization therefore, the solution can be written as
kbt b ct
=
kbt b ct
= QD t Q
1
kb0 b c0
1 λt1 0 q11 q12 t 0 λ2 q21 q22 det (Q ) {z }| {z }| | Q
kbt b ct
Block (1)
=
1 det (Q )
D
q11 λt1 q12 λt2 q21 λt1 q22 λt2
Quant. Macro
q22 q21 {z
Q
q12 q11
1
q22 kb0 q12 b c0 q21 kb0 + q11 b c0
}
October 2017
kb0 b c0
116 / 159
Solving the (log-linearized) optimal growth model
from which we arrive at solution:
kbt b ct
=
0
q11 λt1 q22 kb0
1 @ det (Q ) q21 λt1 q22 kb0
Block (1)
q12 b c0 + q12 λt2
q12 b c0 + q22 λt2
Quant. Macro
q21 kb0 + q11 b c0
1
A q21 kb0 + q11 b c0 (22)
October 2017
117 / 159
Solving the (log-linearized) optimal growth model
has an explosive part and a stable part: known as a saddle-path unstable system. since λt2 ! ∞ we have an explosive eigenvalue and the system will blow up as t ! ∞, we have to shut down the explosive paths we do this by setting b c0 just right (since kb0 is given, this is our one degree of freedom) economically, choosing b c0 such that explosive paths are shut down is exactly what the transversality condition is about (or implicit non-negativity constraints on consumption and capital)
Block (1)
Quant. Macro
October 2017
118 / 159
Solving the (log-linearized) optimal growth model
kb0 will insure inspecting equation (22), setting b c0 = qq21 11 q21 kb0 + q11 b c0 = 0 and will wipe out the unstable dynamics. Hence, our complete (stable) solution is: 1 0 q 21 q q q 11 22 12 q 11 1 kbt A λt1 kb0 @ = (23) b ct det (P ) q21 q22 q12 q21 q 11
summary: in practice this means: we can …rst compute matrix W , then compute the eigenvalues and eigenvectors to get Q and then pick the stable eigenvalue so that we have a bounded solution.
Block (1)
Quant. Macro
October 2017
119 / 159
Solving the (log-linearized) optimal growth model Graphical interpretation on the optimal growth model: Phase diagram
rewrite (11) as: ∆ct +1 = β 1 δ + αktα+11 ct ∆kt +1 = ktα δkt ct
Block (1)
Quant. Macro
1 γ
1
(24)
October 2017
120 / 159
Solving the (log-linearized) optimal growth model can rewrite above solution in format we are used to in economics: today’s states and today’s control variables are a (linear) function of past states write as: kbt +1 = φk kbt , b ct = φ kbt ,
(25) (26)
c
1 det (P ) φ φc = φc 0 , k
where φk = found as
h
q11 q22
q12 qq21 11
i
λ1 , and where φc can be i h and where φc 0 = det1(P ) q21 q22 q12 qq21 λ1 . 11
note: this is exactly the same solution we found via the method of undetermined coe¢ cients. Block (1)
Quant. Macro
October 2017
121 / 159
Solving the (log-linearized) optimal growth model open and inspect the Matlab …le ’growth.m’:
Block (1)
Quant. Macro
October 2017
122 / 159
Optimal growth model Extensions
could add labor choice: F (Kt , Nt ) = Ktα Nt1
α
could add growth: F (Kt , Xt Nt ) = Ktα (Xt Nt )1
α
, where
X t +1 Xt
=γ
could add uncertainty: this is what we will do now!
Block (1)
Quant. Macro
October 2017
123 / 159
Stochastic growth model Adding uncertainty
introduce uncertainty: dynamics implied by neoclassical growth model still do not resemble the time series of the main macroeconomic variables at business cycle frequencies add stochastic shocks into neoclassical framework: ! RBC model (still without labor choice)
yt = At f (Kt ) = At ktα ,
(27)
at +1 = ρat + εt +1 ,
(28)
where at = log (At ), εt +1 is white noise with variance σ2ε . A = 1 ( ! at = b at ) Block (1)
Quant. Macro
October 2017
124 / 159
Stochastic growth model planner’s problem: ( ∞
L = E0
∑ βt
t =0
1 γ
ct + λt [At ktα + (1 1 γ
δ) kt
ct
kt +1 ]
)
similar steps as before lead to a system of nonlinear di¤erence equations in ct , kt and at :
ct
γ
n = βEt ct +γ1 1
ct + kt +1 = At ktα + (1
δ + αAktα+11 δ) kt ,
o
, (29)
at +1 = ρat + εt +1 , with lim
t !∞
Block (1)
t
σ
β ct kt +1
= 0 and k0 and a0 given
Quant. Macro
October 2017
125 / 159
Stochastic growth model
as before: only in exceptional cases analytical solution exists in general: need numerical approximation of the solution when log-linearizing: need a point around which to conduct the 1st order Taylor approximation: point that is typically chosen is the non-stochastic steady state
Block (1)
Quant. Macro
October 2017
126 / 159
Stochastic growth model
caveats: important to notice that in models with stochastic shocks, the steady state is characterized by stationary distributions and not by points common practice is nevertheless to choose the steady state of a deterministic (non-stochastic) version of the model but, caution: we should be aware that it is never assured that a deterministic steady state is indeed an interesting place to analyze dynamics, as it might have a low unconditional probability in the stochastic model
Block (1)
Quant. Macro
October 2017
127 / 159
Stochastic growth model
another important assumption of the log-lin. approximation method is that it imposes certainty equivalence: allows us to eliminate expectations operator (in the Euler Equation) and to reinstate it in front of all future unknown variables once a solution is found this operation is possible because the covariance matrix of the stochastic shock does not enter the linear policy rules whatever the degree of risk, the decision rules remain unchanged agents behave as if they lived in a world with no uncertainty they still su¤er form uncertainty: it lowers their welfare since preferences still imply risk aversion, but the do not react to it
Block (1)
Quant. Macro
October 2017
128 / 159
Log-linearized stochastic growth model
log-linear equivalent to equations (29), system of linear di¤erence equations from the stochastic growth model:
γb ct
= Et
n
γb ct + 1 + [ 1
c k b ct + kbt +1 = at + αkbt + (1 y y at +1 = ρat + εt +1 ,
Block (1)
β (1
k δ) kbt y
Quant. Macro
h δ)] (α
io 1) kbt +1 + at +1(30)
October 2017
129 / 159
Log-linearized stochastic growth model can be written (using certainty equivalence) in matrix notation: AEt zt +1 = Bzt
(31)
note that we can write any (log-) linearized model in the above general format. mapping the stochastic growth model into this format gives: 3 2 3 2 kbt +1 kbt AEt 4 at +1 5 = B 4 at 5 b ct + 1 b ct Block (1)
Quant. Macro
October 2017
(32)
130 / 159
Log-linearized stochastic growth model
2 6 4
[1
| 2
β (1
δ)] (α 0 k y
Block (1)
{z A
0 0 α + (1 δ) ky {z |
6 = 4
1) [1
B
0 ρ 1
β (1 1 0
32
3
γ kbt 4 0 7 5 at 5 c b ct y } | {z }
δ)]
3 2 γ 0 7 5 Et 4 0 }|
3 kbt +1 at + 1 5 b ct + 1 {z }
E t z t +1
(33)
zt
Quant. Macro
October 2017
131 / 159
Solving the (log-linearized) stochastic growth model
we will look at three ways to solve the system in (31) method of undetermined coe¢ cients matrix algebra: solving a standard eigenvalue problem, using diagonalization matrix algebra: solving linear systems with the Schur (QZ) decompositions, solving a generalized eigenvalue problem, using triagonalization
Block (1)
Quant. Macro
October 2017
132 / 159
Log-linearized stochastic growth model Method of undetermined coe¢ cients
continue to assume A is invertible, premultiply system (31) by A de…ning W = A 1 B to get: Et zt +1 = Wzt
Block (1)
Quant. Macro
1,
(34)
October 2017
133 / 159
Solving the (log-linearized) stochastic growth model Method of undetermined coe¢ cients
similarly to before, guess solutions:
kbt +1 = φkk kbt + φka at b ct = φ kbt + φ at ck
ca
use these guesses and substitute into equation (32) 2
3 φkk φka b 4 5 kt 0 ρ at φck φkk φck ρ + φck φka 3 2 w11 + w13 φck w12 + w13 φca 5 0 ρ = 4 w31 + w33 φck w32 + w33 φca Block (1)
Quant. Macro
(35) kbt at October 2017
(36)
134 / 159
Solving the (log-linearized) stochastic growth model Method of undetermined coe¢ cients
solve for the φ coe¢ cients: φkk φka φck φkk φck ρ + φck φka
= = = =
w11 + w13 φck w12 + w13 φca w31 + w33 φck w32 + w33 φca
which gives a system of 4 equations in 4 variables: φkk , φka , φck , and φca .
Block (1)
Quant. Macro
October 2017
135 / 159
Solving the (log-linearized) stochastic growth model Method of undetermined coe¢ cients
plug 1st equation into 3rd equation: gives w13 φ2ck
(w33
w11 ) φck
w31 = 0
with solution: φck =
(w33
w11 )
q
[ (w33
w11 )]2 + 4w13 w31
2w13
select the smaller root ! have φck ... ! have φkk , φca and φck ...
Block (1)
Quant. Macro
October 2017
136 / 159
Solution of the (log-linearized) stochastic growth model Method of undetermined coe¢ cients
have found the coe¢ cients in (1st order approximated) solution: kbt +1 = φkk kbt + φka at , b ct = φ kbt + φ at , ck
ca
only functions of parameters once parameters have been assigned values, know the equilibrium dynamics of stochstic growth model of at , kbt , and b ct .
Block (1)
Quant. Macro
October 2017
137 / 159
Solution of the (log-linearized) stochastic growth model
After solving for the φ’s it is straigtforward to obtain the policy functions for output and investment:
ybt
bit
Block (1)
= at + αkbt , 1 δb 1b = kt +1 kt δ δ φkk 1 δ b = kt + φka at δ δ
Quant. Macro
October 2017
138 / 159
Solving the (log-linearized) stochastic growth model open and inspect the Matlab …le ’stochasticgrowth.m’:
Block (1)
Quant. Macro
October 2017
139 / 159
State space representation de…ne xt vector of state variables (end. and ex.), of size nx 1 yt vector of control variables, of size ny 1 0 et + 1 = ∅ e t + 1 is a vector of size nx 1, which is partitioned into a vector of zeros of size (nx nε ) 1 and a vector of exogenous shocks of size nε 1
can write solution to any linear system in its state-space representation as:
xt +1 = Hxt + Fet +1 , yt where H is nx Block (1)
nx , G is ny
(37)
= Gxt , nx , F is nx Quant. Macro
nε October 2017
140 / 159
Stochastic growth model in state space representation
example 1: map solution of stochastic growth model into this format:
φkk φka kbt +1 = 0 ρ at + 1 | {z }| | {z } x t +1
H
φ φ ct ] = [b |{z} | ck {z ca yt
Block (1)
G
0 0 kbt + , 1 ε t +1 at {z } | {z } | {z } xt
F
e t +1
kbt , } at | {z } xt
Quant. Macro
October 2017
141 / 159
Stochastic growth model in state space representation example 2: map solution of stochastic growth model into this format when carrying all variables of interest (including output and investment) in the system:
φkk φka kbt +1 = 0 ρ at + 1 | {z }| | {z } x t +1
2
3
2
b ct 4 ybt 5 = 6 4 bit | {z } | yt
Block (1)
H
φck α
φkk δ
0 0 kbt + , 1 ε t +1 at | {z } | {z } {z }
1 δ δ
{z G
Quant. Macro
xt
3
φca 1 7 5 φka | }
F
e t +1
kbt , at {z } xt
October 2017
142 / 159
Impulse Responses what can we do with solution? Impulse Responses: provide information on the system’s average conditional response to a shock at date t response of the system in period t + k to an impulse in the j th element of et +1 at date t + 1 is
xt +k yt +k
Block (1)
E [xt +k jxt ] = H k
E [yt +k jxt ] = GH k
Quant. Macro
1
F ejt +1 1
F ejt +1
October 2017
143 / 159
Model Simulation
what can we do with solution? Model Simulation: done by iterating on system (37) for a given random sequence of the vector of shocks et +k , k = 1, ..., T
Block (1)
Quant. Macro
October 2017
144 / 159
Solving the (log-linearized) stochastic growth model
we said we consider three approaches to solving the system in (31), i.e. solving: AEt zt +1 = Bzt method of undetermined coe¢ cients matrix algebra: solving a standard eigenvalue problem, using diagonalization matrix algebra: solving a generalized eigenvalue problem (Schur decomposition), using triagonalization
Block (1)
Quant. Macro
October 2017
145 / 159
Solving the (log-linearized) stochastic growth model Matrix algebra, diagonalization
so far, we used the method of undetermined coe¢ cients alternatively, as with the optimal growth model (without uncertainty), we could have used matrix algebra based on solving a standard eigenvalue problem, and based on using diagonalization ... but, recall: this approach can only be used if matrix A is invertible (has full rank); unfortunately, this assumption is often not satis…ed.
Block (1)
Quant. Macro
October 2017
146 / 159
Solving the (log-linearized) stochastic growth model Matrix A not invertible
in richer models matrix A is often not invertible. This, in particular, is the case if the system includes (some) static variable(s) (see example on next slide) the method based on diagonalization of W = A standard eigenvalue problem) cannot be applied!
1B
(solving a
BUT: can still solve linear systems with the Schur (QZ) decomposition, solving a generalized eigenvalue problem the Schur (QZ ) decomposition has become a default algorithm to solving linear (rational expectations) systems!
Block (1)
Quant. Macro
October 2017
147 / 159
Solving the (log-linearized) stochastic growth model Matrix A not invertible
example: assume we carry output, ybt , in the linear system of the stochastic growth model: io n h γb ct = E t γb ct +1 + [1 β (1 δ)] (α 1) kbt +1 + at +1(38) c k b ct + kbt y y ybt
at + 1
Block (1)
= ybt + (1
k δ) kbt y
= at + αkbt = ρat + εt +1 ,
Quant. Macro
(39)
October 2017
148 / 159
Solving the (log-linearized) stochastic growth model Matrix A not invertible
2 6 6 6 4
| 2
6 6 = 6 4 |
[1
β (1
δ)] (α 0
1) [1
k y
0 0 0 (1 δ) ky α
0 ρ 1 0 {z B
γ 0 c y
0
{z A 32
0 0 1 1
76 76 74 5 }|
β (1 1 0 0 kbt at b ct ybt {z zt
3 7 7 5
δ)]
γ 0 0 0
0 0 0 0
3
2
kbt +1 7 6 7 6 at + 1 7 Et 4 b ct + 1 5 ybt +1 {z }| E t z t +1
3 7 7 5 }
(40)
}
matrix A no longer has full rank ! cannot take inverse Block (1)
Quant. Macro
October 2017
149 / 159
Solving linear systems with the Schur (QZ) decomposition
can write the linearized system of stochastic di¤erence equations as AEt [zt +1 ] = Bzt
(41)
where zt = [xt , yt ]0 collects the state variables xt and the controls yt . note that in the simple stochastic growth model, we had chosen zt such that A was invertible and W = A 1 B.
The QZ decomposition does not require A to be invertible, which means that additional static (intratemporal) equilibrium conditions can be included among the dynamic relationships.
Block (1)
Quant. Macro
October 2017
150 / 159
Solving linear systems with the Schur (QZ) decomposition
we are looking for a solution of the form
xt +1 = Hxt + Fet +1 yt
Block (1)
(42)
= Gxt
Quant. Macro
(43)
October 2017
151 / 159
Solving linear systems with the Schur (QZ) decomposition
consider the real generalized Schur (QZ) decomposition: QAZ QBZ
= S is upper block triangular = T is upper block triangular
moreover, Q H Q = Z H Z = I , where superscript H denotes the Hermitian transpose. de…ne the generalized eigenvalue λi as the ratio of the i-th diagonal element of T and S. if A is invertible, then λi is just the i-th eigenvalue of W if A is singular, some of its diagonal elements are zero and the corresponding λi is treated as in…nite
Block (1)
Quant. Macro
October 2017
152 / 159
Solving linear systems with the Schur (QZ) decomposition
it turns out there exists a real QZ decomposition for every ordering of λi let S and T be arranged in such a way that the stable (i.e. smaller than one) generalized eigenvalues come …rst and the unstable (exceeding one and in…nite) come last correspondingly, de…ne the auxiliary variables zt = Z e zt = Z
zts ztu
=
Z11 Z12 Z21 Z22
zts ztu
(44)
where zts are the stable transformed variables and ztu are the transformed unstable variables.
Block (1)
Quant. Macro
October 2017
153 / 159
Solving linear systems with the Schur (QZ) decomposition
hence AZEt [e zt +1 ] = BZ e zt
(45)
pre-multiplying by Q gives a new system equivalent to (41)
S11 S12 0 S22
SEt
zts+1 ztu+1
=T
Et
zts+1 ztu+1
=
zts ztu
,
T11 T12 0 T22
(46) zts ztu
,
where S11 and T22 are square and invertible by assumption.
Block (1)
Quant. Macro
October 2017
154 / 159
Solving linear systems with the Schur (QZ) decomposition hence, we can write ztu = T221 S22 Et [ztu+1 ]
(47)
furthermore, the generalized eigenvalues associated with S22 and T22 are all unstable by construction. therefore, after solving forward, the solution for e zt will explode unless ztu = 0
given our solution for ztu , we have that Et [zts+1 ] = S111 T11 zts ,
(48)
where S111 T11 is a stable matrix by construction. Block (1)
Quant. Macro
October 2017
155 / 159
Solving linear systems with the Schur (QZ) decomposition
de…ning e et +1 = Z11 zts+1 Et zts+1 as the error in expectations and under the important assumption that Z11 is invertible we can write zts+1 ztu+1
=
S111 T11 0 0 0
zts ztu
+
Z111 0 0 0
and after premultiplying by Z zt +1 = Z
Block (1)
S111 T11 0 0 0
Quant. Macro
Z H zt +
e et + 1 0
e et + 1 0
(49)
(50)
October 2017
156 / 159
Solving linear systems with the Schur (QZ) decomposition
from the de…nition of the transformed variables we have that xt +1 =
Z11 Z12
zts ztu
=
Z21 Z22
zts ztu
yt
Block (1)
Quant. Macro
October 2017
157 / 159
Solving linear systems with the Schur (QZ) decomposition
which leads to xt +1 = Z11 S111 T11 Z111 xt + e et + 1 yt
= Z21 Z111 xt
the …nal step is to pin down the expectational error e et +1 , which is done by theoretical motivations: e et +1 = Fet +1
Block (1)
Quant. Macro
October 2017
158 / 159
Solving linear systems with the Schur (QZ) decomposition
the code by Paul Klein (solab.m) implements the QZ decomposition for any model supplied in the format of AEt [zt +1 ] = Bzt . open and inspect the Matlab …le ’stochasticgrowth.m’: [G,H]=solab(A,B,2)
Block (1)
Quant. Macro
October 2017
159 / 159