In [10]:
%run src/markov_switching.py

In [11]:
import matplotlib.pyplot as plt

In [12]:
jlm_compute_stat_discrete()


Out[12]:
(1.0050378991640063, 0.9956664286149705)

In [13]:
jlm_compute_stat_discrete(ψ=1.97, β=0.999)


Out[13]:
(1.0050378991640063, 1.0014749487047336)

In [14]:
G = 30
gamma_vals = np.linspace(5, 15, G)
sigma1_vals = np.linspace(0.001, 0.01, G)

In [15]:
R = np.empty((G, G))

for i, γ in enumerate(gamma_vals):
    for j, σ_1 in enumerate(sigma1_vals):
        MC, _ = jlm_compute_stat_discrete(γ=γ, σ_1=σ_1)
        R[i, j] = MC

In [16]:
x, y = np.meshgrid(gamma_vals, sigma1_vals)

fig = plt.figure(figsize=(10, 6))
ax = fig.add_subplot(111)

cs1 = ax.contourf(x, y, R.T, alpha=0.5)

ctr1 = ax.contour(x, y, R.T, "k", levels=[1.0048, 1.005], colors=["black"])

plt.clabel(ctr1, inline=1, fontsize=13, fmt="%1.4f")
plt.colorbar(cs1, ax=ax)

ax.set_xlabel("$\gamma$", fontsize=16)
ax.set_ylabel("$\sigma(1)$", fontsize=16)

plt.savefig("temp.pdf")

plt.show()



In [ ]:


In [ ]: