Teaching Economics with Interactive Browser-Based Models
TTechnische Universit¨at BerlinFakult¨at VIIInstitut f¨ur Volkswirtschaftslehre & WirtschaftsrechtFachgebiet Makro¨okonomik
Teaching Economics with Interactive Browser-Based Models
Companion Paper to the IS-LM, AD-AS and Solow Model Simulation Toolkits written byJuan Dominguez-Moran < @osyphys > Rouven Geismar < [email protected] > a r X i v : . [ q -f i n . GN ] A ug able of Contents References 9 Introduction
This paper is a companion paper to the browser-based simulation toolkits of the IS-LM,AD-AS and the Solow growth model. The tools are written by Dominguez-Moran andGeismar (2020) and can be found on GitLab ( https://gitlab.tubit.tu-berlin.de/chair-of-macroeconomics ). The paper describes how the simulation toolkits can beused to study and teach macroeconomic models and get an intuition for their comparativestatics. They facilitate an easy understanding of the underlying economic concepts andthe mechanics of the IS-LM, AD-AS and the Solow growth model which are commonlyused in academic teaching.Based on the example of the IS-LM model, this paper demonstrates the functionalitiesand the innovative features of the toolkits. In addition, the structure of the IS-LM pro-gram code, which is distributed under the open source software license GNU AGPLv3, ispresented. The software is implemented using Python and the interactive visualizationlibrary bokeh. If you use the simulation tools for teaching, we would be grateful for your feedback ora picture of you utilizing the toolkits in class. If you find inspiration in this project forbuilding your own interactive model, we would very much appreciate if you could let usknow about your project by mail ([email protected]) or twitter (@osyphys).
The basic version of the IS-LM model explains how output Y and interest rate i aredetermined in the short-run. Its simplicity and intuititve appeal are reasons for why itis still used in accademic teaching. It captures essential economic phenomena and henceprovides a good starting point for teaching economics. The model describes equilibriaon the goods (IS-curve) and the financial (LM-curve) markets. The intersection of bothcurves determines the short-run equilibrium of the economy. To study the labor market,wage and price developments in the medium- and long-run, one has to use a different The toolkits were developed as part of a project about innovative teaching. All software is writtenby Juan Dominguez-Moran (@osyphys) and Rouven Geismar ([email protected]) at the Chair ofMacroeconomics at Technische Universit¨at Berlin. For more information about how to use the AD-AS and Solow model toolkits, please see the instruc-tion sections implemented in the respective toolkit. The IS-LM program code and documentation can be found at https://gitlab.tubit.tu-berlin.de/chair-of-macroeconomics . Van Rossum and Drake, 2009 (see also ) and Team, 2020 (see also https://docs.bokeh.org/ ). For more details and discussion of the IS-LM framework seeBlanchard, 2017 or Blanchard et al., 2017.
Aggregate consumption in the economy is given by C = A + c ( Y − T ) where A denotesautonomous consumption, c is the marginal propensity to consume, Y denotes aggregateproduction ( (cid:98) = aggregate income) and T are lump-sum taxes. Aggregate investment isdefined as I = B − br . B denotes autonomous investment, b is the responsiveness ofinvestment to interest rates and r denotes the real interest rate. The Fisher equation isgiven by r = i − π e where i is the nominal interest rate and π e is expected inflation. Theaggregate demand for goods is given by ZZ = C + I + G + N X where G is governmentspending and N X are net exports. In the short-run equilibrium the demand for goodshas to equal production, ZZ = Y . Using the previous definitions and rearranging theequation yields the negatively sloped IS-equationIS-curve: Y = 11 − c ( A + B + G + N X − cT + bπ e ) − b − c i. (1)The economic intuition is that an increase in the interest rate leads to a decrease ininvestment, and hence output. Since output corresponds to aggregate income, people cutback their consumption. This reduction in aggregate demand depresses economic activityfurther and creates a ‘multiplier effect’. The aggregate real money demand is given by L ( Y, i ) = h Y − h i where h and h are theresponsiveness of income to money demand and the responsiveness of money demand tointerest rates, respectively. The real money supply is denoted by M/P where P denotesthe price level. When money supply equals money demand, M/P = L ( Y, i ), the financialmarkets are in equilibrium. Because the nominal interest rate is assumed to be greater orequal to zero, the LM-curve exhibits a kink at the zero lower bound:LM-curve: i = max (cid:34) , h h Y − Mh P (cid:35) . (2)The intuition for the positive slope of the LM-curve is that an increase in income leadsto an increase in money demand (e.g. transaction motive). If the central bank decidesto hold the money supply fixed (‘money supply control’) the interest rate has to rise toequilibrate money supply and money demand. If the central bank decides to hold theinterest rate fixed (‘interest rate control’) the money supply has to adjust endogenously. A simulation tool for a basic version of the AD-AS model can be found at the Chair of Macroeconomicsat Technische Universit¨at Berlin . Section 1 Section 2
Figure 1:
User Interface
An aggregate macroeconomic equilibrium is defined as a state where the goods marketand the financial markets are simultaneously in equilibrium. This is the case where theIS and the LM curves intersect.
The user interface (UI) of the program is divided into two major sections. In Section 1the model’s parameter values (inputs) are chosen. Section 2 represents the analysis anddescription section.
Section 1:
This section provides the input values for the model. There are threedifferent model tabs (
Model 1 to Model 3 ) which can be used for conducting counterfac-tual analysis (see Chapter 2.3). To distinguish between the Models throughout the userinterface, different and unique colors are used for every Model. The blue button on thetop restores the default values (
Model 1 ) or copies the parameter values of the previousmodel tab (
Model 2 and
Model 3 ). To choose parameter values for the IS or the LMequations the sliders have to be adjusted accordingly. As default, the central bank isassumed to conduct ‘money supply control’, i.e. money supply is set exogenously and theinterest rate adjusts endogenously to it. To adjust the interest rate directly, the slider onthe bottom labeled ‘interest rate control’ can be used to set the interest rate exogenously.In this case, the money supply adjusts accordingly.
Section 2:
This section includes three tabs. The
Results tab displays all relevantresults. It shows the numerical equilibrium values (top-left), the composition of the5ross domestic product (top-right) as well as graphical results for the IS-LM Model, themoney market and the goods market on the bottom. All graphs are interactive. Onecan add/remove the different models (
Model
Model 3 ) by clicking on the respectivebuttons above the graphs or the bar chart. Different options for manipulating, saving andanalyzing the content are placed to the right of each graph. The
Model Set-up tab showsall relevant model equations and the notation used. The
Instructions tab provides a briefexplanation of how to use the IS-LM-Model program.
To conduct counterfactual analysis, three models (tabs
Model 1 to Model 3 ) will serveas a ‘playground’. We will now analyze what happens to the short run equilibrium if theeconomy experiences an increase in aggregate demand (e.g. an increase in governmentspending G ). We will start with the default values given by model 1. In this case,the equilibrium values of the output and interest rate of the economy are given by 1050currency units (CU) and 5%, respectively. Now we use the
Model 2 tab to simulate anexogenous government spending shock. First, we copy the starting values of
Model 1 to Model 2 by pressing the ‘Assign Values of Model 1’ button on top of Section 1. To seechanges to the model happen in real time, we turn on the plots for
Model 2 by pressingthe ‘Model 2’ buttons on top of each graph. Now, we increase government spending G to310 CU by using the slider. This shifts the IS-curve to the right and the deficit increasesto -110 CU. If the central bank decides to keep the money supply fixed (‘money supplycontrol’) the interest rate rises to offset the rise in money demand. This leads to crowdingout of private investment. Now, suppose the central bank wants to accommodate theincrease in the nominal interest rate by increasing the money supply. To implement thispolicy response, first copy the parameter values of Model 2 to Model 3 . Then increasethe money supply M by moving the slider as long as the interest rate is back on itsstarting value of Model 1 . Alternatively, implement the target interest rate directly bymoving the slider ‘Interest Rate Control’. In the latter case, the money supply will adjustendogenously to the interest rate set by the central bank. As a result, the LM-curvemoves to the right until it crosses the new IS-curve at the old interest rate. This definesthe economy’s new short-run equilibrium with higher output and private consumption.Now students can compare the effects of the original shock in
Model 2 with the effects ofthe policy response in
Model 3 . See ‘Equilibrium values’ in Section 2. Press the button ‘Assign Values of Model 2’ on top of the tab
Model 3 . Please keep in mind that the slider ‘Interest Rate Control’ will not update endogenously if moneysupply changes. Program Details (Quite) Loosely based on the Model-View-Controller software design pattern, the programis composed mainly of: • data.py : model equations and how to calculate initial data • input.py : parameter adjustment widgets coupled to the model update callback inconfig/interaction.py • output.py : how to plot and show results • main.py : where everything is put together based on arguments specified in config/*.json and the standalone html/IS_LM.html is generatedThe program has no object-orientation. In ./demo there is a version that can run offlinesince the scripts that are usually loaded from the bokeh server have been downloaded andtheir paths specified in the standalone html. The file in config/build_config.py is anoptional tool for creating the config files. Since the whole program makes generalized useof dictionary unpacking when invoking functions, it is possible for example to not onlychange arguments destined for plot style, but to add new parameters by looking up theirnames in the bokeh docs. Prerequisites can be installed using pip as follows: pip install -r requirements.txt
The command to create the standalone html at html/IS-LM.html is python3 main.py GNU AFFERO GENERAL PUBLIC LICENSE Version 3, 19 November 2007Copyright c (cid:13) eferences Blanchard, Oliver. 2017.
Macroeconomics . Pearson.Blanchard, Oliver, Alessia Amighini, and Francesco Giavazzi. 2017.
Macroeconomics: AEuropean Perspective . 3rd Edition. Massachusetts Institute of Technology.Team, Bokeh Development. 2020.
Bokeh: Python library for interactive visualization .Van Rossum, Guido, and Fred L. Drake. 2009.