The Real Cost of Inflation under Nominally Rigid Wages¶
Gianmarco Corradini, MS¶
Modules¶
import numpy as np
import math as m
import matplotlib as mp
import scipy as sp
from scipy.integrate import quad
from matplotlib import pyplot as plt
from scipy.integrate import dblquad
Stochastic Real Inflation¶
diff_cache1 = {}
diff_cache2 = {}
diff_cache3 = {}
r = 0.01
zy1=0.02
zy2=0.05
zy3=0.1
c=0.90
z1=(1+zy1)**(1/12)-1
z2=(1+zy2)**(1/12)-1
z3=(1+zy3)**(1/12)-1
r0=(1+r)**(1/12)-1
print(z1, z2, z3,r0)
def S1(t):
if t in diff_cache1:
return diff_cache1[t]
if t == 0:
value = 0
elif t >0:
value = 1+S1(t-1)*(1+r0)-c*((1+z1)**t)
diff_cache1[t] = value
return value
def S2(t):
if t in diff_cache2:
return diff_cache2[t]
if t == 0:
value = 0
elif t >0:
value = 1+S2(t-1)*(1+r0)-c*((1+z2)**t)
diff_cache2[t] = value
return value
def S3(t):
if t in diff_cache3:
return diff_cache3[t]
if t == 0:
value = 0
elif t >0:
value = 1+S3(t-1)*(1+r0)-c*((1+z3)**t)
diff_cache3[t] = value
return value
S_1 = []
S_2 = []
S_3 = []
X_AX= []
S_0 = []
for i in range(0, 36):
S_1.append(S1(i))
S_2.append(S2(i))
S_3.append(S3(i))
X_AX.append(i)
S_0.append(0)
plt.plot(X_AX, S_1)
plt.plot(X_AX, S_2, color='green')
plt.plot(X_AX, S_3, color='orange')
plt.plot(X_AX, S_0, '--', color = 'black', linewidth = 0.5)
[<matplotlib.lines.Line2D at 0x78827196d240>]
def IC(t,x):
return c*(((((1+x)**t -1)*(1+x))/x)-t)
def IC_h(t,x):
return IC(x,T)*1/160
IC_1 = []
IC_2 = []
IC_3 = []
for i in range(0, 36):
IC_1.append(IC(i,z1))
IC_2.append(IC(i,z2))
IC_3.append(IC(i,z3))
plt.plot(X_AX, IC_1)
plt.plot(X_AX, IC_2, color='green')
plt.plot(X_AX, IC_3, color='orange')
[<matplotlib.lines.Line2D at 0x78826f8300a0>]