Anda di halaman 1dari 17

A dynamic AS-AD model with MATLAB

Jos Maria Lopes Gaspar


April 23, 2013

This assignment was developed for the course of Computational Economics of the doctoral pro-
gramme in Economics at the School of Economics and Management, University of Porto.
1
Abstract
I use the framework implicit in the model of ination by Shone (1997) to
address the analytical properties of a simple dynamic AS-AD model and solve
it numerically. The AS-AD model is built by incorporating an expectations-
augmented Phillips curve within an IS-LM framework. I use a program developed
in MATLAB to plot the numerical solutions of the model and simulate 5 possible
outcomes in terms of phase portraits using dierent parameter values. The same
program also accommodates for the implementation of monetary policy shocks
through changes in the growth rate of money supply, scal policy shocks due
to variations in public spending and in the exogenous tax rate, and supply side
shocks as given by changes in the level of natural output.
1 Introduction
The simple AS-AD model is a bulwark used in economic theory to explain economic
uctuations and business cycles. Its dynamic version presented here can be used to
assess the dynamic adjustments of output and ination after dierent macroeconomic
shocks. Due to the specication of the model, it is possible to verify that the equilibria
of the model can be either stable or unstable spirals or nodes, or stable centres, but
there are no saddle points. Using a program developed in MATLAB, I portray the
dynamics of the model using dierent parameter values by means of an illustration
that includes, not only the evolution of real output and ination throughout time, but
also a phase diagram that fully describes the qualitative properties of its equilibria.
I consider three types of shocks: monetary supply shocks, scal policy shocks, and
supply side shocks. The rst shocks operate through changes in the growth rate of
money supply. Fiscal policy shocks are consequences of changes in either the level of
public spending or the exogenous tax rate. The latter shocks are technological shocks
that exogenously aect the level of natural output. The program in MATLAB allows
for the combination between the dierent shocks.
The organization of the rest of this assignment is as follows. The second section derives
the model and studies its analytical properties. The third section contains simulations
for dierent parameter values, each specication pertaining to a dierent phase portrait.
2
The fourth section addresses the simulation of dierent shock types and the last section
concludes.
2 Model and analysis
Most of the construction of the model follows Ronald Shone (1997, chap. 9). I begin
by deriving the aggregate demand side (the IS-LM model). Starting with the goods
market, consumption is given by:
c = c
0
+ b(1 )y, 0 < b, < 1,
where is the exogenous tax rate. Investment is equal to:
i = i
0
h(r
e
), h > 0,
where r stands for the nominal interest rate and
e
is the expected ination rate. Hence,
investment depends negatively on the real interest rate. Real output is given by:
y = c + i + g,
where g corresponds to the exogenous level of government spending. The previous
equations allows us to derive the IS curve.
The money market (LM curve) is described by the following equations:
m
d
= ky dr
m
s
= mp
m
d
= m
s
,
where m
d
represents real money demand in logs, m
s
is the real money supply in logs,
and p is the logarithm of the price level. Combining the results for the goods and money
3
market, we can solve for y

and r

to obtain:
y

=
(c
0
+ i
0
+ g) +
h
d
(mp) + h
e
1 b(1 ) +
hk
d
r

=
ky

(mp)
d
.
Hereinafter, I shall focus solely on y

, the equilibrium level of real output. Notice that


it is a linear equation in terms of the real money supply and expected ination, i.e.,
y = a
0
+ a
1
(mp) + a
2

e
, (1)
a
0
=
c
0
+ i
0
+ g
1 b(1 ) +
hk
d
,
a
1
=
h
d
1 b(1 ) +
hk
d
,
a
2
=
h
1 b(1 ) +
hk
d
Equation (1) represents our aggregate demand (AD) curve, since it denotes equilibrium
in both the goods and money market.
Turning to the supply side, I assume that the rate of ination is proportional to the
output gap and adjusted for expected ination as follows:
= (y y
n
) +
e
, > 0
This is our aggregate supply (AS) curve. It stems from the combination between an
augmented Phillips curve =
e
a(UU
n
) and Okuns law, whereby UU
n
= b(y
y
n
), with a, b > 0. The AS curve represents a situation where prices are completely
exible. Thus, in equilibrium, actual ination equals expected ination and output
equals its natural level whatever the price level p.
Introducing a dynamic adjustment for inationary expectation and taking the derivative
4
of (1) with respect to time, we get the full model:
y = a
1
( m) + a
2

e
, a
1
, a
2
> 0 (2)
= (y y
n
) +
e
, (3)

e
= (
e
), > 0. (4)
The adaptive expectations scheme for expected ination in the last equation shows that
agents revise their expectations upwards whenever ination at any given time is higher
than the expected ination at that same time. Equation (2) is the demand pressure
curve. To consider the dynamics of the model, we shall reduce it to 2 dierential
equations. Using (3 ) and (4) together, we obtain:

e
= (y y
n
). (5)
Next, we take equations (3) and (5) and plug them into (2) to get:
y = a
1
( m(y y
n
) +
e
) + a
2
(y y
n
)
y = a
1
m(a
1
a
2
)(y y
n
) a
1

e
.
Thus, the dynamics of the model are fully described by the following two dierential
equations:
y = a
1
m(a
1
a
2
)(y y
n
) a
1

e
= (y y
n
). (6)
Notice that the two state variables are real output and expected ination. However,
actual ination can be readily obtained from the AS curve in (3), hence:
(t) = (y(t) y
n
) +
e
(t).
Clearly, a steady state implies that

e
= 0 and y = 0. From the rst condition we
get y = y
n
. Combining this result with the second condition we end up with
e
= m.
From the AS curve it immediately follows that =
e
= m in steady state. That is, in
equilibrium, real output is given by the natural level of output and actual ination is
equal to the growth rate of the money supply. From the

e
= 0 locus we can see that if
y > y
n
,
e
is rising. Conversely, if y < y
n
,
e
is declining. Considering the y = 0 locus
5
we have:

e
= m
_
1
a
2

a
1
_
(y y
n
).
Thus, what happens to y above or below the y = 0 locus depends on the slope of
the previous equation. If 1 a
2
/a
1
> 0
1
, the previous equation is negatively sloped.
Hence, to the left or below the y = 0 locus, y is increasing. To the right, there are
forces decreasing y.
Now, consider again the dynamical system in (6). The jacobian matrix of the system
at equilibrium:
J =
_
_
(a
1
a
2
) a
1
0
_
_
.
It is straightforward to check that the determinant of the matrix is det(J) = a
1
> 0.
Since it is positive, there are no eigenvalues with real parts of opposite sign. Hence
there are no saddle points. The trace of the matrix is given by:
tr(J) = (a
1
a
2
)
tr(J) =
_
_
_
_
h
d
h
1 b(1 ) +
bk
d
_
_
_
_
.
Since b(1) < 1, the denominator is clearly positive. Moreover, since > 0, the trace
is negative if and only if h/d > h. Hence, we can say that the equilibrium is stable
if 1/d > and unstable if 1/d < . The condition that 1/d > is exactly the same
as requiring 1 a
2
/a
1
> 0. This means that if the y = 0 curve is negatively sloped,
the equilibrium (y

,
e
) = (y
n
, m) is stable. This is assumed in Shone (1997), but not
1
This condition is assumed in Shone (1997). As we shall see further ahead, this condition is sucient
for stability of the equilibrium of the model. For the sake of numerical presentation, I do not assume
this holds a priori.
6
here. The condition for the existence of complex eigenvalues is:
4a
1
>
2
_
_
_
_
h
d
h
1 b(1 ) +
bk
d
_
_
_
_
2

d
>
h
_
1
d

_
2
1 b(1 ) +
bk
d
.
A low enough clearly favours oscillatory solutions. Finally, if 1/d = we get a null
trace and complex eigenvalues because 4/d > 0. This means that we get a stable
centre. Thus, we can say that the equilibrium is stable if and only if 1/d . On
the account of the previous analysis, it is clear that this version of a dynamic AS-AD
model accounts for either the possibility of stable or unstable nodes or spirals, or a
stable centre, depending on the parameters chosen.
3 Numerical evaluation
In this section I present some numerical simulations with dierent parameter values,
illustrating the ve dierent types of solutions that may arise in the AS-AD model.
The program used was developed in MATLAB (le ASADdynamic.m) by the author.
For the moment, I shall refrain from the introduction of shocks to the model, which is
left for the next section. The programs output is twofold. First, it presents the values
of the parameters used, as well as the steady state values for real output, expected and
actual ination. For the sake of presentation, I omit the output from the command
window. Second, it provides illustrations for the evolution of the solutions through
time and the corresponding phase portrait.
The rst simulation, which uses the default parameter values in the program, depicts
the solution for a stable spiral. The parameters used are c
0
= 10; i
0
= 5; G = 5; b =
0.8; k = 0.05; d = 0.05; h = 0.1; = 0.3; = 0.1; = 1; m = 0.01; y
n
= 1.
7
0 20 40 60 80 100
0
0.2
0.4
0.6
0.8
1
1.2
1.4
Output
time
y


y
0 20 40 60 80 100
0.2
0.15
0.1
0.05
0
0.05
0.1
0.15
Actual inflation and expected inflation
time

Figure 1 To the left: solution for y(t). To the right: (t) and
e
(t). (1)
We have1/d > , hence the steady state (y

,
e
) = (y
n
, m) is stable, as we can see from
gure 1. Also, the solutions are clearly oscillatory. One can check that actual ination
oscillates more than the expected ination and naturally the latter follows the rst in
its adjustment.
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6
0.1
0.05
0
0.05
0.1
0.15


Phase diagram
y

e
Solution
Vector eld
y = 0

e
= 0 (LR PC)
Figure 2 Phase diagram clearly depicts a stable spiral.
Figure 2 illustrates the phase diagram which clearly shows the stable spiral.
The second simulation presents a dierent dynamic adjustment. I set d = 0.5 and
= 2, all other parameter valuers remaining equal. Since 1/d = the solution is a
stable centre. The evolution of output, expected and actual ination and the phase
8
diagram are depicted in gures 3 and 4, respectively.
0 20 40 60 80 100
0
0.5
1
1.5
2
Output
time
y


y
0 20 40 60 80 100
1
0.5
0
0.5
1
Actual inflation and expected inflation
time

Figure 3 To the left: solution for y(t). To the right: solutions for (t) and
e
(t). (2)
Both gures show that there is no convergence towards the steady state, as well as no
divergence as the solutions are periodic.
0 0.5 1 1.5 2
0.8
0.6
0.4
0.2
0
0.2
0.4
0.6
0.8


Phase diagram
y

e
Solution
Vector eld
y = 0

e
= 0 (LR PC)
Figure 4 Phase diagram shows that the equilibrium is a stable centre.
Figure 4 presents no y = 0 locus, since its slope is equal to zero, as we can infer from
the analysis in the previous section.
I now set d = 1 and = 1.2, with all other parameter values equal to the default
set-up. Inasmuch as > 1/d we can predict that the equilibrium will be unstable.
Moreover, because of this, the y = 0 is negatively sloped. Furthermore, with this set
9
of parameters, the solutions can be shown to be unstable spirals (recall also that is
very low). This is conrmed by gures 5 and 6.
0 20 40 60 80 100
0.5
0
0.5
1
1.5
2
2.5
Output
time
y


y
0 20 40 60 80 100
1
0.5
0
0.5
1
Actual inflation and expected inflation
time

Figure 5 To the left: solution for y(t). To the right: solutions for (t) and
e
(t). (3)
Once again, we can see that expected ination follows up closely after actual ination,
reecting the way by which expectations are formed.
0 0.5 1 1.5 2 2.5
1
0.8
0.6
0.4
0.2
0
0.2
0.4
0.6
0.8
1


Phase diagram
y

e
Solution
Vector eld
y = 0

e
= 0 (LR PC)
Figure 6 Phase diagram illustrates an unstable spiral that diverges from the steady
state.
The remainder of the simulations can be checked in the appendix. The parametrization
required for the equilibrium to be either a stable or an unstable node seems highly
unrealistic as it imposes too high values for , implying an almost immediate adjustment
10
of output and ination. For this reason, it seems more plausible to arm that the
dynamic adjustment of the AS-AD model is always oscillatory. Therefore, the remainder
cases are less interesting and left for the appendix. Obviously, if we assume the same
condition as in Shone (1997) that requires that the y = 0 is negatively sloped, then
unstable equilibria would not be possible in the rst place.
4 Modeling shocks
In this section I introduce three dierent types of shocks to the dynamic AS-AD model
using the same program in MATLAB. A combination between any of the shocks is
possible, but for the sake of presentation I shall simulate each separately and report
the results. The baseline set for parameter values presented here is the same across all
simulations and is equal to the default (rst) set-up presented in the previous section.
First, I run an expansionary scal policy shock, setting new values for public spending
and the tax rate at G = 5.5 and = 0.25, after the program asks for the implementation
of policy shocks. Previous to the shock, the economy is at equilibrium with =
e
=
0.01 and y = 1. After a permanent increase in the government spending and permanent
decrease in the tax rate at time t
0
, the economy must jump up to a higher level output.
This is given by the AD curve in (1). At t
0
, real output y jumps from its natural level
to the new level y
0
= 2.0799.
1
The economy is no longer at equilibrium. Since the level
of natural output is unchanged, the economy will converge to equilibrium and will do
so in an oscillatory fashion, after a very sharp decrease in output in the rst periods.
Conversely, ination increases sharply after t
0
(however, it does not change at t
0
) but
then starts to converge to its initial value, also oscillating. This situation is described
in gure 7.
1
This result is given by the new initial condition y
0
from the output in the command window from
ASADdynamic.m.
11
0 20 40 60 80 100
0.5
1
1.5
2
2.5
Output
time
y


y
0 20 40 60 80 100
0.05
0
0.05
0.1
0.15
0.2
Actual inflation and expected inflation
time

Figure 7 Fiscal policy shock. To the left: solution for y(t). To the right: solutions for
(t) and
e
(t).
The

e
= 0 and y = 0 loci are unaected after the shock and the steady state lies at their
intersection. Figure 8 shows the phase diagram, with the economy slowly returning to
the steady state after its deviation at t
0
due to the scal policy shock.
0.5 1 1.5 2 2.5 3
0.05
0
0.05
0.1
0.15
0.2


Phase diagram
y

e
Solution
Vector eld
y = 0 (1)
y = 0 (2)

e
= 0 (LR PC) (1)

e
= 0 (LR PC) (2)
Figure 8 Phase diagram portraying the dynamic adjustment after a scal policy shock.
The second shock is an expansionary monetary policy shock. For it, set the money
supply growth rate m = 0.04 when the program asks for it. Once again, previous to the
shock, the economy is at equilibrium with y = y
n
= 1 and
e
= = m = 0.01. After
the shock occurring at t
0
, the y = 0 locus (2) shifts upwards. Hence, the economy is
out of equilibrium, and will oscillate towards the new steady state, where y = 1 and
12

e
= 0.04. This situation is reported in gure 9.
0 20 40 60 80 100
0.95
1
1.05
1.1
1.15
1.2
1.25
Output
time
y


y
0 20 40 60 80 100
0.01
0.02
0.03
0.04
0.05
0.06
Actual inflation and expected inflation
time

Figure 9 Monetary policy shock. To the left: solution for y(t). To the right: solutions
for (t) and
e
(t).
Initially, output will rise as will ination. After y crosses the y = 0 locus, it will start
to decrease while ination continues to rise. Only when the solution crosses the

e
= 0
locus will ination start to fall. At this point, expected ination will be above its steady
state value and output will be lower than y
n
. The oscillating process continues as output
converges to its natural level y
n
= 1 and expected and actual ination converge to their
new equilibrium value m = 0.04. The previous description is illustrated in gure 10.
0.7 0.8 0.9 1 1.1 1.2 1.3 1.4 1.5 1.6
0.01
0.02
0.03
0.04
0.05
0.06
0.07
0.08


Phase diagram
y

e
Solution
Vector eld
y = 0 (1)
y = 0 (2)

e
= 0 (LR PC) (1)

e
= 0 (LR PC) (2)
Figure 10 Phase diagram portraying the dynamic adjustment after a monetary policy
shock.
13
The third and nal shock we will consider is a positive supply side shock. It is given
by a positive technological shock which, for exogenous reasons, aects the natural level
of output, such that y
n
= 2. At the time of the shock, both the

e
= 0 and y = 0
loci shift rightwards, which is straightforward from (3) and (2). Hence, the economy
will adjust towards the new steady state given by the intersection between the two
new curves. Since the growth rate of money supply is unchanged, we can anticipate
that the steady state levels of actual and expected ination are the same and given
by =
e
= 0.01. However, real output at the new steady state is now given by
y = y
n
= 2. Again, convergence towards the new equilibrium is made in an oscillatory
fashion, with a decrease in both actual and expected ination and an increase in real
output in the rst periods. This situation is depicted in pictures 11 and 12.
0 20 40 60 80 100
0.5
1
1.5
2
2.5
Output
time
y


y
0 20 40 60 80 100
0.15
0.1
0.05
0
0.05
0.1
Actual inflation and expected inflation
time

Figure 11 Supply side shock. To the left: solution for y(t). To the right: solutions for
(t) and
e
(t).
14
1 1.5 2 2.5 3 3.5
0.15
0.1
0.05
0
0.05
0.1


Phase diagram
y

e
Solution
Vector eld
y = 0 (1)
y = 0 (2)

e
= 0 (LR PC) (1)

e
= 0 (LR PC) (2)
Figure 12 Phase diagram portraying the dynamic adjustment after a supply side shock.
Conclusions
I have studied the dynamic properties of a simple dynamic version of the well known
AS-AD model and used a program developed in MATLAB to solve it numerically.
Standard eigenvalue inspection of the system of the resulting two dierential equations
implies that we may have either stable or unstable spirals or nodes or stable centres,
but no saddle point solutions. Numerical simulation of the model with recurrence
to the program developed in MATLAB has permitted to illustrate dierent cases of
dynamic adjustments, with a complete description of the results. Furthermore, the
program conveniently accounts for the possibility of implementing dierent shocks after
the initial simulation. These shocks pertain to monetary and scal policy shocks, as
well as supply side shocks. The program shows how the transition to new steady state
levels may occur, with appropriate illustrations and output.
References
Shone, R. (1997), Economic Dynamics: Phase diagrams and their economic application,
Cambridge University Press.
15
Appendix
Fourth simulation with c
0
= 10; i
0
= 5; G = 5; b = 0.8; k = 0.05; d = 0.05; h = 0.1; =
0.3; = 30; = 1; m = 0.01; y
n
= 1. The result is a stable node. Convergence to the
steady state is almost immediate.
0 20 40 60 80 100
0
0.2
0.4
0.6
0.8
1
1.2
1.4
Output
time
y


y
0 20 40 60 80 100
30
25
20
15
10
5
0
5
Actual inflation and expected inflation
time

Figure 13 To the left: solution for y(t). To the right: solutions for (t) and
e
(t). (4)
0.2 0.4 0.6 0.8 1 1.2
0.15
0.1
0.05
0
0.05
0.1
0.15


Phase diagram
y

e
Solution
Vector eld
y = 0

e
= 0 (LR PC)
Figure 14 Stable node.
Fifth simulation with c
0
= 10; i
0
= 5; G = 5; b = 0.8; k = 0.05; d = 10; h = 0.1; =
0.3; = 50; = 0.2; m = 0.01; y
n
= 1. The result is an unstable node.
16
0 10 20 30 40 50
15
10
5
0
5
x 10
18 Output
time
y


y
0 10 20 30 40 50
10
8
6
4
2
0
2
x 10
20Actual inflation and expected inflation
time

Figure 15 To the left: solution for y(t). To the right: solutions for (t) and
e
(t). (5)
18 16 14 12 10 8 6 4 2 0
x 10
18
2
1.8
1.6
1.4
1.2
1
0.8
0.6
0.4
0.2
0
x 10
20


Phase diagram
y

e
Solution
Vector eld
y = 0

e
= 0 (LR PC)
Figure 16 Unstable node.
17

Anda mungkin juga menyukai