DIY Macroeconomic Model Simulation (using Mathematica)
DIY Macroeconomic Model Simulation (using Mathematica)
Monetary Economics (Wynne Godley, et al) SIM model:
Using Recurrence functions
Using Recurrence functions
C
s
C
d
G
s
G
d
T
s
T
d
N
s
N
d
YD =
W*
N
s
T
s
T
d
N
s
C
d
α
1
α
2
H
h-1
α
1
α
2
H
h-1
ΔH
s
H
s
H
s-1
G
d
T
d
H
s
ΔH
h
H
h
H
h-1
C
d
H
h
Y =
C
s
G
s
N
d
N
d
In[]:=
Manipulate[Module[{params,sim},ClearAll[y,yd,td,,,,,,,,c1,c2];params={->g,θ->taxRate,c1->consumeRate,c2->overspend};sim=RecurrenceTable[{y[t]==[t]+[t],[t]==[t]-[t-1],[t]==[t]-[t-1],[t]==[t],[t]==[t],[t]==c1yd[t]+c2[t-1],td[t]==θy[t-1],yd[t]==y[t]-θy[t-1],y[0]==0,[0]==0,yd[0]==0,[0]==0,[0]==0,td[0]==0}/.params,{y,yd,td,,},{t,1,50}];ListLinePlot[sim//Transpose,AxesLabel->{"Time","Value"},PlotLegends->{"y","yd","td","c","h"}]],{{g,20,"gov"},1,30},{{taxRate,.2},0.1,1.0,.1},{{consumeRate,.6},0.1,1.0,.1},{{overspend,.4},0.1,1.0,.1}]
c
s
c
d
g
s
g
d,
h
s
h
d
Δh
s
Δh
h
g
s
c
s
g
s
Δh
s
h
s
h
s
Δh
h
h
h
h
h
c
s
c
d
g
s
g
d
c
d
h
h
c
s
h
h
h
s
c
d
h
d
