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., [612]), 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.

The second simulation presents a different dynamic adjustment. We set and , all other parameter values remaining equal. Since the equilibrium is now a stable centre. The evolution of output and expected and actual inflation and the phase diagram are depicted in Figures 3 and 4, respectively.

Both figures show that there is no convergence or divergence towards the steady state, as the latter is only stable in the Lyapunov sense. All solutions are periodic orbits with period , where is the imaginary part of the corresponding complex eigenvalues.

Figure 4 presents no locus, since its slope is equal to zero, as we can infer from the analysis in the previous section.

For the third simulation, we now set and , with all other parameter values equal to the default setup. Inasmuch as we know that the equilibrium will be unstable. Moreover, because of this, is negatively sloped. Furthermore, with this set of parameters, the equilibrium can be shown to be an unstable focus (recall also that is very low), so the solution oscillates away from the steady state. This is confirmed by Figures 5 and 6.

Once again, we can see that expected inflation follows up closely after actual inflation, reflecting the way by which expectations are formed.

In the fourth simulation we set and dramatically decrease to . Now the eigenvalues are real and, since , the equilibrium is a stable node.

By inspection of Figure 7 one can observe that, contrary to the previous cases, expectations are now formed correctly, as expected inflation now decreases steadily towards the steady state level, whereas actual inflation overshoots its equilibrium level, following the evolution of real output.

Figure 8 shows the phase diagram where we can observe that the steady state is a stable node in the fourth simulation.

Remark 4. The parametrization required for the equilibrium to become an unstable node seems implausible as it imposes either exceedingly high values for or implies trajectories assuming negative values for output. Therefore, we rule out this possibility.

4. Modeling Shocks

In this section we introduce three different types of shocks to the dynamic AS-AD model. A combination between any of the shocks is possible, but for the sake of presentation we 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 (first) setup presented in Section 3.

First, we run an expansionary fiscal policy shock, setting new values for public spending and the tax rate at and , respectively, after the program asks for the implementation of policy shocks. Previous to the shock, the economy is at equilibrium with and . After a permanent increase in the government spending and permanent decrease in the tax rate at the initial time , the economy must jump up to a higher level output. This is given by the AD curve in (8). At , real output jumps to a new level (this result is given by the new initial condition from the output in the command window from Matlab. See Appendix B.2 for more details). The economy is now further away from its equilibrium level. Since the level of natural output is unchanged, the economy will converge to its initial equilibrium level and will do so in an oscillatory fashion, after a very sharp decrease in output in the first periods. Conversely, inflation increases sharply after (however, it does not change at but then starts to converge to its initial value, also oscillating. This situation is described in Figure 9.

The and loci are unaffected after the shock and the steady state lie at their intersection. Figure 10 shows the phase diagram, with the economy slowly returning to the steady state after its deviation at due to the fiscal policy shock.

The second shock is an expansionary monetary policy shock. We set the money supply growth rate once the function asks to set new parameter values. Once again, previous to the shock, the economy is at equilibrium with and After the shock occurring at , the locus (11) shifts upwards. Hence, the economy is out of equilibrium and will oscillate towards the new steady state, where and This situation is reported in Figure 11.

Initially, output will rise as will inflation. After crosses the locus, it will start to decrease while inflation continues to rise. Only when the solution crosses the locus will inflation start to fall. At this point, expected inflation will lie above its steady state value and output will be lower than . The oscillating process continues as output converges to its natural level and expected and actual inflation converge to their new equilibrium value . This process is illustrated in Figure 12.

The third and final shock we consider is a supply side shock. It is given by a positive technological shock which, for exogenous reasons, affects the natural level of output, such that . At the time of the shock, both and loci shift rightwards, which is straightforward from (12) and (11). 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 inflation are the same and given by . However, real output at the new steady state is now given by . Again, convergence towards the new equilibrium is oscillatory, with a decrease in both actual and expected inflation and an increase in real output in the first periods. This case is depicted in Figures 13 and 14.

5. Concluding Remarks

We studied the dynamic properties of a simple dynamic version of the well known AD-AS model and used code, embedded in a single Matlab function, to simulate the model in order to numerically analyse the dynamic adjustments in the economy under a wide array of different applications concerning policy shocks.

By standard analytical inspection of the linearised system of the resulting two differential equations, we find that the inflation model may have either stable or unstable spirals (focuses), or nodes, but no saddle point equilibria. Unstable nodes are ruled out numerically. A degenerate Hopf bifurcation occurs when the value of the demand for money balance’s sensitivity to variations in the nominal interest rate is inversely proportional to the way expectations on inflation are formed, which explains the smooth transition between unstable and stable focuses. However, the model’s linearity naturally rules out any possibility for occurrence of limit cycles.

Numerical simulations of the model with recurrence to the function developed in Matlab allow for the illustration of different cases of dynamic adjustments, with a complete description of the results. Furthermore, the function conveniently accounts for the possibility of implementing different shocks after the initial simulation. These shocks pertain to monetary and fiscal policy shocks and supply side shocks. The function also shows how the transition to new steady state levels may occur, with appropriate illustrations and output.

One of our goals is to motivate researchers both within and outside the economics profession for the prospective complementarity in both analytical and numerical approaches. Shunning away computer simulations for the sake of closed form solution and elegant mathematics may preclude tackling more realistic settings, or otherwise intractable. This could thwart possible theoretical and empirical contributions that are potentially relevant for policy makers.

Admittedly, the AD-AS model is oversimplifying in its assumptions and limited in accounting for complex business cycles and other economic phenomena. We do not see this as a contradiction in our goals, nor does it defeat our purposes. For instance, further extensions of this simple setup could build theoretical improvements based on microfoundations for Keynesian aggregate demand and aggregate supply such as in Farmer [24]. Other possible developments would include incorporating technological changes and determine their impact on economic growth rates, following works such as Dutt [25].

It is in our view, however, that the simplicity and perceptiveness of the AS-AD model studied here allows us to better convey our message and thus contributes to further connect the bridge between economic models’ analytical results and computer based numerical simulations.

Appendix

A. Proof of Proposition 3

Here we provide the full analytical proof that the AD-AS model undergoes a Hopf bifurcation at .

Proof of Proposition 3. Let , denote the pair of eigenvalues obtained from the Jacobian matrix in (20), where is the bifurcation parameter. The conditions for existence of a Hopf bifurcation [26], [27, Th. 3.4.2 in p. 151] are given by(i);(ii);(iii). When , the condition for existence of complex eigenvalues in (22) is satisfied, since Therefore, we have , which satisfies condition (i). Next, gives us the trace of the Jacobian matrix, , evaluated at the bifurcation point . This yieldswhich satisfies condition (ii).
Finally, taking the first-order derivative of , we getEvaluating at yieldsHence, condition (iii) holds and the model undergoes a Hopf bifurcation at The additional genericity condition that the first Lyapunov exponent is nonzero, [28] [27, Th. 3.4.2 (H2) p. 151] is as follows:where is the first Lyapunov exponent, , and in (13) and subscripts denoting different order derivatives evaluated at equilibrium and at . Since all the derivatives of order higher or equal to 2 are zero, we have . Therefore, no periodic solutions exist for , and the bifurcation is degenerate, which concludes the proof.

B. Matlab’s Output in Command Window

In this Appendix we provide the Matlab function’s reports on some of the simulations and shocks exemplified in the previous sections.

B.1. Output for First Simulation

The first example is given after the first simulation, using the default parameter values set by the program (see Section 3) (See Box 1).

B.2. Output for First Shock

After the expansionary fiscal shock (recall Section 4), the function’s reported output in Matlab’s command window was as in Box 2.

Disclosure

Part of this work was developed while José M. Gaspar was a Ph.D. student at the School of Economics and Management, University of Porto.

Conflicts of Interest

The author declares that they have no conflicts of interest.

Acknowledgments

The author thanks Óscar Afonso and Paulo B. Vasconcelos for very useful comments and suggestions. José M. Gaspar gratefully acknowledges support from CEF.UP. This research was financed by the European Regional Development Fund through COMPETE 2020, Programa Operacional Competitividade e Internacionalização (POCI), and by Portuguese Public Funds through Fundação para a Ciência e Tecnologia in the framework of the project POCI-01-0145-FEDER-006890 and the Ph.D. scholarship SFRH/BD/90953/2012.

Supplementary Materials

The Matlab code is embedded in a single function (ADASdynamic.m). Add the “.m” file to the working Matlab path/directory. Open Matlab and run the name of the file in the command window (ADASdynamic). The programme asks the user to introduce values for the parameters described throughout the paper, including the initial time and final time. It then produces three figures and one for the solution , another for both and , and the last one shows the phase diagram portraying the transition dynamics. The programme will then ask the user to implement either monetary, fiscal, supply side shocks, or any possible combination of shocks, by introducing new values for the money growth rate, public spending, tax rate, and level of natural output. This will produce three new graphs, with the same information as described previously, but compared to the initial situation. Therefore, the figures shown after implementing shocks will portray the global transition dynamics towards the new equilibrium. Along these processes, the output for the relevant steady state levels and their qualitative properties are shown in Matlab’s command window, along with the parameter values. See Appendix for an example of how the output is displayed in Matlab’s command window. (Supplementary Materials)