Journal of Applied Mathematics

Volume 2018 (2018), Article ID 3193068, 13 pages

https://doi.org/10.1155/2018/3193068

## Bridging the Gap between Economic Modelling and Simulation: A Simple Dynamic Aggregate Demand-Aggregate Supply Model with Matlab

Correspondence should be addressed to José M. Gaspar; tp.pcu.otrop@rapsagj

Received 13 July 2017; Accepted 28 November 2017; Published 16 January 2018

Academic Editor: Oluwole D. Makinde

Copyright © 2018 José M. Gaspar. This is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

#### Abstract

This paper aims to connect the bridge between analytical results and the use of the computer for numerical simulations in economics. We address the analytical properties of a simple dynamic aggregate demand and aggregate supply (AD-AS) model and solve it numerically. The model undergoes a bifurcation as its steady state smoothly interchanges stability depending on the relationship between the impact of real interest rate on demand for liquidity and how fast agents revise their expectations on inflation. Using code embedded into a unique function in Matlab, we plot the numerical solutions of the model and simulate different dynamic adjustments using different parameter values. The same function also accommodates the analysis of the impacts of fiscal and monetary policy and supply side shocks on the steady state and the transition dynamics of the model.

#### 1. Introduction

This study seeks to provide a contribution of potential interest to researchers both within the economics profession and from different fields by highlighting the connection between analytical results and computer simulation. Our purposes are twofold: (i) we seek to show, starting from a simple dynamic inflation model used in Economics, how we can use the computer to provide “end user” programs that are potentially useful and also easy to use by analysts and (ii) sensitize researchers in economics and other mathematically intensive sciences to the fact that numerical simulations should not be shun away based on the ground that they are only useful when explicit or closed form analytical solutions cannot be obtained [1, 2] (however, we do not claim that there are no economists who made extensive use of computational capabilities, specially in the fields of agent-based modelling and simulation. See, e.g., Macal and North [3, 4] and Macal [5] for an overview on the state of the art). With this in mind, our paper analyses a simple dynamic inflation model, the aggregate demand-aggregate supply (AD-AS) model. We first derive analytical results and study the qualitative properties of its equilibria through local stability analysis. We then proceed to show numerical results to illustrate global dynamics and phase plots that depict transition dynamics that occur when we introduce changes in exogenous economic variables.

The AD-AS model is one of the bulwarks used in economic theory to explain economic fluctuations and business cycles. Its dynamic version presented here can be used to assess the dynamic adjustments of output and inflation after different macroeconomic shocks. Due to the specification of the model, it is possible to verify that the equilibria of the model interchange stability depending on the relation between the sensitivity of the demand for liquidity to variations in the interest rate and how fast agents revise their expectations on inflation. In fact, we can characterize the model’s fixed points as stable or unstable spirals, or as stable or unstable nodes (we shall see in Section 4 that unstable nodes turn out to be numerically ruled out). This qualitative change in the local flow near the equilibrium is explained by the existence of a (degenerate) Hopf bifurcation as the pair of eigenvalues yielded by the corresponding two-dimensional dynamic system crosses the imaginary axis along a smooth parameter path where the impact of the real interest rate on the agents' demand for real money steadily increases.

Contrary to many business cycle studies (e.g., [6–12]), the absence of nonlinearity in our simpler setup rules out the possibility of limit cycles and other more complex economic behaviours (typically, a Hopf bifurcation requires the branching from an equilibrium into a periodic orbit. Here, we use the term “Hopf” just to highlight the fact that a fixed point looses stability as the eigenvalues of the Jacobian at the fixed point cross the imaginary axis of the complex plain). De Cesare and Sportelli [13], Neamu et al. [14], Zhou and Li [15], and Sportelli et al. [16] provide an interesting study on how limit cycles generated by Hopf bifurcations may arise in inflation models when there exists a finite lag between the accrual and payment of taxes, which implies a qualitative study of delay differential equations.

Using code embedded in a single function developed in Matlab, we portray the global dynamics of the model using different parameter values by means of an illustration that includes, not only the evolution of real output and inflation throughout time but also a phase diagram that fully describes the qualitative properties of its equilibria and the transition dynamics. This code also allows us to simulate different types of exogenous shocks, both individually and simultaneously, to the economy, and their impact on the economy’s main aggregate variables, that is, real output and inflation. The simulations numerically depict the transition dynamics and adjustment processes of the state variables after the shocks occur. We consider three types of shocks: monetary supply shocks, fiscal policy shocks, and supply side shocks. The first 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 affect the level of natural output. The Matlab function also allows for the combination between the different shocks.

As noted by Wilson [17], the purpose of illustrating mathematical results derived from models in a clear and appealing way is often defeated by the inherent intractability of more cumbersome frameworks. Thus, it is our contention that there is a need for a more open mindedness of economists (and also researchers in other fields). Therefore, we hope to motivate to the fact that analytical analysis and numerical assessment should be complementary, not substitutes (however, certifying this complementarity implies that previous model verification and validation are essential [18]). By means of a simple yet insightful macroeconomic model, our computational approach provides illustrations that are both intelligible and visually attractive. Therefore, it allows us to clearly convey the messages behind the analytical analysis of the model by means of a compact and complete illustration, thus contributing to further connect the bridge between modelling and computer simulation (our effort thus goes along the lines of the technical appendix developed by King et al. [19], who describe the methods and software used to analyse in detail the neoclassical economy in the seminal works in King et al. [20, 21]). From a prospective view, the choice of a simple dynamic inflation model is thus intentional. It also seeks to appeal to readers who are not acquainted with economic theory and its models but are still able to understand the economic intuition behind the results of the simple model presented here.

The organization of the rest of this paper is as follows. Section 2 derives the model and studies its analytical properties. Section 3 contains simulations for different parameter values, each specification pertaining to a different phase portrait. Section 4 addresses the simulation of different shock types. The last section is left for concluding remarks.

#### 2. Model and Analysis

The model presented here loosely follows the one proposed by Shone [22, chap. 9] We begin by deriving the aggregate demand side, the “investment-saving” and “liquidity preference-money supply” (IS-LM) model. Starting with the goods market (IS curve), consumption is given bywhere is both real aggregate output and aggregate income, corresponds to autonomous consumption, is the exogenous tax rate, and is the fraction of disposable income, , that agents wish to consume. Investment is equal towhere corresponds to autonomous investment, stands for the nominal interest rate, is the expected inflation rate, and is a parameter that captures how agents are sensitive to variations in the real interest rate, . The higher the real interest rate, the lower the investment level.

Real output is given bywhere corresponds to the exogenous level of government spending. Plugging (1) and (2) into (3) we are able to derive the IS curve.

The money market (LM curve) is described by the following equations:where represents real money demand in logs, is the real money supply in logs, is the logarithm of the price level, is the logarithm of nominal money supply, and and are the values of the money balances demand’s sensitivity to variations in the nominal interest rate and in real output, respectively. Equilibrium in the money market requires that . Using (1), (2), (3), and (5), we can solve for the equilibrium’s level of real output, and the equilibrium’s real interest rate , which yieldsHereinafter, we shall focus solely on . Notice that (6) is linear in real money supply and expected inflation . Therefore, we can rewrite (6) aswhereEquation (8) represents our aggregate demand (AD) curve, since it denotes equilibrium in both the goods and money market.

Turning to the aggregate supply side, we assume that the rate of inflation is proportional to the output gap and adjusted for expected inflation as follows:where is the natural level of output, is a constant, and the output gap equals . This is our aggregate supply (AS) curve. It stems from the combination between an augmented Phillips curve , which states that actual inflation is decreasing in the deviation of unemployment rate relative to its natural level (i.e., actual inflation equals expected inflation minus the variability in unemployment times the constant ) and Okun’s law, whereby , with (Okun’s law states that higher output gap leads to lower unemployment rates. I refer the reader to Lee [23] for a detailed explanation and also its robustness based on empirical evidence). The AS curve represents a situation where prices are completely flexible. Thus, in equilibrium, actual inflation equals expected inflation and output equals its natural level, , whatever the price level .

Introducing a dynamic adjustment for inflationary expectation and taking the derivative of (8) with respect to time, we get the full model:where dotted variables denote their derivatives with respect to time (we omit the explicit dependence of state variables on time to simplify notation, whenever reasonable). The parameters , capture how the rate of change of output reacts to real money supply growth rate () (recall that denotes nominal supply in logs. Hence, its derivate is approximate to its growth rate), on the rate of change of expected inflation , respectively. The parameter measures how expected inflation changes according to the difference between actual inflation and expected inflation. The adaptive expectations scheme for expected inflation in the last equation shows that agents revise their expectations upwards whenever inflation at any given time is higher than the expected inflation at that same time. Equation (11) is the demand pressure curve. To consider the dynamics of the model, we shall reduce it to 2 differential equations. Using (12) and (13) together, we obtainNext, we take (12) and (14) and plug them into (11) to getThus, the dynamics of the model are fully described by the following two differential equations:Notice that the two state variables are real output and expected inflation . However, actual inflation can be readily obtained from the AS curve in (12). HenceA steady state implies that and . From the first condition and using (17), we get . Combining this result with the second condition we end up with From the AS curve it immediately follows that at steady state. That is, in equilibrium, real output is given by the natural level of output and actual inflation is equal to the growth rate of the money supply. Given the system in (17), from the locus we can see that if , expected inflation is rising. Conversely, if , is declining. Considering the locus we haveThus, what happens to above or below the locus depends on the slope of the previous equation. If , the previous equation is negatively sloped. Hence, to the left or below the locus, is increasing (this condition is assumed in Shone [22]. As we shall see further ahead, this condition is sufficient for stability of the equilibrium of the model. For the sake of numerical presentation, I do not assume this holds a priori). To the right, there are forces decreasing the level of output .

Now, consider again the dynamical system in (17). The Jacobian matrix of the system at equilibrium is given byIt is straightforward to check that the determinant of the matrix in (20) is equal to . 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 bySince , the denominator of is positive. Moreover, since , the trace is negative if and only if Hence, we can say that the equilibrium is stable if and unstable if . The condition that is exactly the same as requiring . This means that if the locus is negatively sloped, the equilibrium is stable. This is assumed ex-ante in Shone [22], but not here.

A necessary and sufficient condition for the existence of complex eigenvalues requires ; that is,A low enough favours oscillatory solutions. Finally, if we get a null trace and complex eigenvalues because . Moreover, the equilibrium is a stable (in the Lyapunov sense) centre, because the eigenvalues are purely imaginary. Thus, the equilibrium is stable if and only if . From the preceding analysis, we can sum up the different qualitative properties of a steady state in the AD-AS model in the following proposition.

Proposition 1. *Depending on the parameters chosen, a steady state in the dynamic AD-AS model can be characterized as a stable or unstable node, a stable or unstable focus (spirals), or a centre.*

The possibility of an interchange between diverging and converging oscillating trajectories suggests that the AD-AS model undergoes a bifurcation. Suppose that the agents’ preference for liquidity (i.e., money demand) becomes increasingly sensitive to changes in the real interest rate. Formally, we have the following assumption.

*Assumption 2. *Let us consider a smooth parameter path where steadily increases; that is, is a bifurcation parameter.

Analysing the relationship between the sensitivity of money demand with respect to the real interest rate and the way agents revise their expectations on inflation based on the prediction error , which is captured by , allows us to provide the following result.

Proposition 3. *The system described by (17) undergoes a degenerate Hopf bifurcation at .*

*Proof. *See Appendix A.

The existence of a (degenerate) Hopf bifurcation explains the transition from a stable focus to an unstable focus, as the eigenvalues cross the imaginary axis at nonzero speed. On the other hand, the linearity of system (17) in its state variables forcibly precludes the existence of limit cycles branching from the steady state; that is, the only periodic orbits occur when and the equilibrium is a Lyapunov stable centre. As the model undergoes the bifurcation, the value of the money balances demand’s sensitivity to variations in the nominal interest rate is inversely proportional to how fast agents adjust their expectations on inflation.

#### 3. Numerical Evaluation

In this section we present some numerical simulations with different parameter values, illustrating the four different types of equilibria and dynamic adjustments that may arise in the AS-AD model. All presented output is generated from a single function embedded in a Matlab script file (the codes in both html and pdf formats can be found through the link: https://sites.google.com/site/josemlopesgaspar/downloads. The description of the Matlab script file is added as a supplemantary material in both pdf and m-file formats (available here). ASADdynamic.m file is additionally available through Github: https://github.com/josemgaspar/Matlab-codes/blob/master/ADASdynamic.m).

For the moment, we shall refrain from the introduction of shocks to the model, which is left for the next section. The function’s output is twofold. First, it presents the values of the parameters used, as well as the steady state values for real output and expected and actual inflation. For the sake of presentation, an illustration of the output shown in Matlab’s command window is presented in Appendix B. Second, it provides illustrations for the evolution of the solutions, along with an intuitive phase portrait.

The first simulation, which uses the default parameter values in the program, depicts the transition dynamics for the solution when the equilibrium is a stable focus. The parameters used are The initial conditions are and , where is the initial time.

We have ; hence the steady state is stable, as we can see from Figure 1. Also, the solutions are clearly oscillating. One can check that actual inflation oscillates more than the expected inflation and, naturally, the latter follows the first in its adjustment. Figure 2 illustrates the phase diagram which depicts the stable spiral.