' MODEL SIM for Eviews version 6 ' from Wynne Godley & Marc Lavoie ' MONETARY ECONOMICS ' Chapter 3 ' This program creates model SIM, described in chapter 3, and simulates the model ' to produce results in Table 3.4, as described in par. 3.4.1, and figures 3.2 & 3.3, ' discussed in par. 3.5 ' **************************************************************************** ' Copyright (c) 2006 Gennaro Zezza ' Permission is hereby granted, free of charge, to any person obtaining a ' copy of this software and associated documentation files (the "Software"), ' to deal in the Software without restriction, including without limitation ' the rights to use, copy, modify, merge, publish, distribute, sublicense, ' and/or sell copies of the Software, and to permit persons to whom the ' Software is furnished to do so, subject to the following conditions: ' ' The above copyright notice and this permission notice shall be included in ' all copies or substantial portions of the Software. ' ' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ' IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ' FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE ' AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ' LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ' FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS ' IN THE SOFTWARE. ' **************************************************************************** ' Create a workfile, naming it SIM, to hold annual data from 1945 to 2010 wfcreate(wf=sim, page=annual) a 1945 2010 ' Creates and documents series series c_d c_d.displayname Consumption goods demand by households series c_s c_s.displayname Consumption goods supply series g_d g_d.displayname Government goods, demand series g_s g_s.displayname Government goods, supply series h_h h_h.displayname Cash money held by households series h_s h_s.displayname Cash money supplied by government series n_d n_d.displayname Demand for labour series n_s n_s.displayname Supply of labour series t_d t_d.displayname Taxes, "demand" series t_s t_s.displayname Taxes, "supply" series w w.displayname Wage rate series y y.displayname Income = GDP series yd yd.displayname Disposable income of households ' Generate parameters series alpha1 alpha1.displayname Propensity to consume out of income series alpha2 alpha2.displayname Propensity to consume out of wealth series theta theta.displayname Tax rate ' Set sample size to all workfile range smpl @all ' Assign values for ' PARAMETERS alpha1=0.6 alpha2=0.4 theta=0.2 ' EXOGENOUS ' note: government expenditure is zero up to 1954 smpl @first 1959 g_d=0 smpl 1960 @last g_d=20 smpl @all w=1 ' Starting values for stocks h_h = 0 h_s = 0 ' Create a model object, and name it sim_mod model sim_mod ' Add equations to model SIM sim_mod.append c_s = c_d sim_mod.append g_s = g_d sim_mod.append t_s = t_d sim_mod.append n_s = n_d sim_mod.append yd = w*n_s - t_s sim_mod.append t_d = theta*w*n_s sim_mod.append c_d = alpha1*yd + alpha2*h_h(-1) sim_mod.append h_s = h_s(-1) + g_d - t_d sim_mod.append h_h = h_h(-1) + yd - c_d sim_mod.append y = c_s + g_s sim_mod.append n_d = y/w ' Select the baseline scenario sim_mod.scenario baseline ' Solve the model for the current sample sim_mod.solve(i=p) ' Create variables for (simulated) changes in stocks genr dh_s_0 = h_s_0 - h_s_0(-1) genr dh_h_0 = h_h_0 - h_h_0(-1) ' Creates tables and charts from simulated variables ' Create Table 3.4 in the book from simulated values table(13, 5) table3_4 table3_4(1,1) = "Table 3.4: The impact of $20 of government expenditure" table3_4(3,1) = "Period" setcell(table3_4, 3, 2, "1", "c") setcell(table3_4, 3, 3, "2", "c") setcell(table3_4, 3, 4, "3", "c") setcell(table3_4, 3, 5, "n", "c") setcell(table3_4,5,1,"G", "l") setcell(table3_4, 6,1, "Y = G + C", "l") setcell(table3_4, 7,1, "T = theta.Y", "l") setcell(table3_4, 8,1, "YD = Y - T", "l") setcell(table3_4, 9,1, "C = alpha1.YD+alpha2.H(-1)", "l") setcell(table3_4, 10,1, "dHs = G - T", "l") setcell(table3_4, 11,1, "dHh = YD - C", "l") setcell(table3_4, 12,1, "H = dH + H(-1)", "l") table3_4.setmerge(a1:e1) table3_4.setwidth(1) 25 table3_4.setwidth(2:5) 6 table3_4.setlines(a4:e4) +d !countvar = 0 for %var g_d y_0 t_d_0 yd_0 c_d_0 dh_s_0 dh_h_0 h_h_0 !countvar=!countvar+1 !count=0 for %year 1959 1960 1961 2010 !count = !count+1 setcell(table3_4,4+!countvar,1+!count,@elem({%var}, %year), 0) next next show table3_4 ' Creates the chart in Figure 3.2 smpl 1957 2001 graph fig3_2.line yd_0 c_d_0 fig3_2.setelem(1) lcolor(red) lwidth(2) lpat(2) fig3_2.setelem(2) lcolor(green) lwidth(2) lpat(3) fig3_2.name(1) Income YD fig3_2.name(2) Consumption C fig3_2.addtext(t,just(c)) Figure 3.2: YD and C starting from scratch (table 3.4) fig3_2.draw(line, left) 80 show fig3_2 ' Creates the chart in Figure 3.3 smpl 1957 2001 graph fig3_3.line h_h_0 d(h_h_0) fig3_3.setelem(1) lcolor(blue) lwidth(2) lpat(1) fig3_3.setelem(2) lcolor(red) lwidth(2) lpat(3) fig3_3.setelem(1) axis(right) fig3_3.name(1) Wealth level H (money stock) fig3_3.name(2) Household saving (the change in money stock) fig3_3.addtext(t,just(c)) Figure 3.3: Wealth level and wealth change, starting from scratch (table 3.4) fig3_3.scale(left) linear range(0, 13) overlap fig3_3.scale(right) linear range(0, 80) overlap show fig3_3