```
#Clear the environment
rm(list=ls(all=TRUE))
# Set number of scenarios (including baselines)
S=6
#Create vector in which equilibrium solutions from different parameterisations will be stored
u_star=vector(length=S) # utilisation rate
g_star=vector(length=S) # growth rate of capital stock
s_star=vector(length=S) # saving rate
c_star=vector(length=S) # consumption rate
r_star=vector(length=S) # profit rate
# Set exogenous variables whose parameterisation changes across regimes
g0=vector(length=S) # animal spirits
sw=vector(length=S) # propensity to save out of wages
h=vector(length=S) # profit share
g1=vector(length=S) # sensitivity of investment with respect to utilisation
### Construct different scenarios across 3 regimes: (1) WLD/WLG, (2) WLD/PLG, (3) PLD/PLG
# baseline WLD/WLG
g0[1]=0.02
g1[1]=0.1
h[1]=0.2
# increase in profit share in WLD/WLG regime
g0[2]=0.02
g1[2]=0.1
h[2]=0.3
# baseline WLD/PLG
g0[3]=0.02
g1[3]=0.08
h[3]=0.2
# increase in profit share in WLD/PLG regime
g0[4]=0.02
g1[4]=0.08
h[4]=0.3
# baseline PLD/PLG
g0[5]=-0.01
g1[5]=0.1
h[5]=0.2
# increase in profit share in PLD/PLG regime
g0[6]=-0.01
g1[6]=0.1
h[6]=0.3
#Set constant parameter values
v=3 # capital-to-potential output ratio
g2=0.1 # sensitivity of investment with respect to profit share
sp=0.9 # propensity to save out of profits
sw=0.3 # propensity to save out of wages
#Check Keynesian stability condition for all scenarios
for (i in 1:S){
print(((sw+(sp-sw)*h[i])*(1/v) -g1[i])>0)
}
```

```
[1] TRUE
[1] TRUE
[1] TRUE
[1] TRUE
[1] TRUE
[1] TRUE
```

```
# Check demand and growth regime for 3 baseline scenarios
for (i in c(1,3,5)){
print(paste("Parameterisation", i, "yields:"))
if(g2*(sw/v - g1[i])-g0[i]*(sp-sw)/v<0){
print("wage-led demand regime")
} else{
print("profit-led demand regime")
}
if(g1[i]*(g2*(sw/v - g1[i])-g0[i]*(sp-sw)/v)+g2*(((sw+(sp-sw)*h[i])*v^(-1)-g1[i])^2)<0){
print("wage-led growth regime")
} else{
print("profit-led growth regime")
}
}
```

```
[1] "Parameterisation 1 yields:"
[1] "wage-led demand regime"
[1] "wage-led growth regime"
[1] "Parameterisation 3 yields:"
[1] "wage-led demand regime"
[1] "profit-led growth regime"
[1] "Parameterisation 5 yields:"
[1] "profit-led demand regime"
[1] "profit-led growth regime"
```

```
# Initialise endogenous variables at some arbitrary positive value
g=1
r=1
c=1
u=1
s=1
#Solve this system numerically through 1000 iterations based on the initialisation
for (i in 1:S){
for (iterations in 1:1000){
#(1) Profit rate
r = (h[i]*u)/v
#(2) Saving
s = (sw+(sp-sw)*h[i])*(u/v)
#(3) Consumption
c= u/v-s
#(4) Investment
g = g0[i]+g1[i]*u+g2*h[i]
#(5) Rate of capacity utilisation
u = v*(c+g)
}
#Save results for different parameterisations in vector
u_star[i]=u
g_star[i]=g
r_star[i]=r
s_star[i]=s
c_star[i]=c
}
```