In [1]:
import numpy as np
import matplotlib.pyplot as plt
import quantecon as qe
In [2]:
np.set_printoptions(suppress=True)
In [3]:
%run src/ssy_fp_discretized.py
%run src/ssy_monte_carlo_test.py
In [4]:
ssy = SSY()
In [5]:
dot_loc = ssy.ψ, ssy.μ_c
In [6]:
G = 6
D = 3
In [7]:
average_wealth_cons(ssy, K=D, I=D, J=D, verbose=True)
Out[7]:
In [8]:
psi_vec = np.linspace(1.1, 4.0, G)
mu_vec = np.linspace(0.003, 0.0005, G)
In [9]:
R = np.empty((G, G))
In [10]:
for i, μ_c in enumerate(mu_vec):
for j, ψ in enumerate(psi_vec):
ssy.ψ = ψ
ssy.μ_c = μ_c
test_function = ssy_function_factory(ssy, parallelization_flag=False)
if test_function() < 1:
R[i, j] = average_wealth_cons(ssy, K=D, I=D, J=D, verbose=False)
else:
R[i, j] = np.inf
In [67]:
R
Out[67]:
In [68]:
start_table = r"""
\begin{table}
\centering
\begin{tabular}{c_string}
"""
In [69]:
end_table = r"""
\end{tabular}
\end{table}
"""
In [71]:
print(start_table)
# Print the first row
for j, ψ in enumerate(psi_vec):
print(f"$\psi$ = {round(ψ, 3)} & ", end='')
print("\\\\")
print("\hline \hline")
for i, μ_c in enumerate(mu_vec):
print(f"$\mu_c$ = {round(μ_c, 4)} & ", end='')
for j in range(G):
print(f"{R[i, j].round(1)} & ", end='')
print('\\\\')
print('\\hline')
print(end_table)
In [ ]: