In [1]:
include("src/utilities.jl")
include("src/bansal_yaron_discretized.jl")
Out[1]:
In [2]:
using PyPlot
plt = PyPlot
Out[2]:
Default parameter values:
In [3]:
ez_bky = EpsteinZinBKY()
sv_bky = StochasticVolatilityBKY()
Out[3]:
In [ ]:
x_vals = linspace(1.25, 2.25, J) # ψ
y_vals = linspace(0.0005, 0.01, J) # μ
In [4]:
for (i, x) in enumerate(x_vals)
for (j, y) in enumerate(y_vals)
ez = EpsteinZinBY(ψ=x)
@assert ez.θ < 0 "Detected non-negative theta value"
K = compute_K_bansal_yaron(ez, sv_bky, μ=y)
R[i, j] = compute_spec_rad(K)
end
end
In [5]:
fig, ax = plt.subplots(figsize=(10, 5.7))
#lvs = [0.0, 0.8, 1.0, 1.4, 1.8, 2.2, 4.4]
#cls = [cm.jet(i) for i in np.linspace(0.4, 1, len(lvs))]
cs1 = ax[:contourf](x_vals,
y_vals,
R',
alpha=0.6)
#levels=lvs,
ctr1 = ax[:contour](x_vals,
y_vals,
R',
levels=[1.0])
plt.clabel(ctr1, inline=1, fontsize=13)
plt.colorbar(cs1, ax=ax)
ax[:set_title]("Spectral radius")
ax[:set_xlabel]("ψ", fontsize=16)
ax[:set_ylabel]("μ", fontsize=16)
ax[:annotate]("Bansal-Kiku-Yaron",
xy=(1.5 + 0.024, 0.0015 - 0.0001),
xycoords="data",
xytext=(5, 40),
textcoords="offset points",
fontsize=12,
arrowprops=Dict("arrowstyle" => "->"))
ax[:plot]([1.5], [0.0015], "ko", alpha=0.6)
plt.savefig("bky.pdf")
plt.show()
In [ ]: