Radial Attention Model
import os import numpy as np import rad_conf from rad import RadialAttentionModel, ParameterDependence print("Loading input from '{}'.".format(rad_conf.RAD_DATA_DIR.split('/')[-1])) print("Saving output in '{}'.".format(rad_conf.RAD_TEMP_DIR.split('/')[-1]))os. model = RadialAttentionModel("msol") rsections = [.1, .5, .7, .9] xsections = [10.0, 20., 50.0, 100.0] rsections_indices = model.grids["r"].lower_bound_index(rsections) rsections_points = {} for r_ind, r_val in enumerate(rsections_indices): idx = np.where(model.variables["s"].data[r_val, :] <= 0)[0][-1] rsections_points[r_ind] = ("$\\bar x (r_{})$".format(r_ind), (model.grids["x"].data[idx], 0)) xsections_indices = model.grids["x"].lower_bound_index(xsections) xsections_points = {} for x_ind, x_val in enumerate(xsections_indices): idx = np.where(model.variables["s"].data[:, x_val] <= 0)[0][0] xsections_points[x_ind] = ("$\\bar r (x_{})$".format(x_ind), (model.grids["r"].data[idx], 0))
model.save_learning_rsections()
Figure 1: Learning radius sections
model.save_cost_rsections()
Figure 2: Cost radius sections
model.variables["s"].save_figs({ "angle": 215, "zlabel": "s", "prefix": "spol", "xsections": xsections, "xsections_points": xsections_points, "rsections": rsections, "rsections_points": rsections_points })
Figure 3: Optimal effort control surface
Figure 4: Optimal effort control radius sections
Figure 5: Optimal effort control wealth sections
model.variables["q"].save_figs({ "angle": 215, "zlabel": "q", "prefix": "qpol", "xsections": [1.0, 2., 4.0, 40.0], "rsections": [.1, .2, .5, .8] })
Figure 6: Optimal quantity control surface
Figure 7: Optimal quantity control radius sections
Figure 8: Optimal quantity control wealth sections
model.variables["v1"].save_figs({ "angle": 215, "zlabel": "v", "prefix": "v" })
Figure 9: Value function surface
Figure 10: Value function radius sections
Figure 11: Value function wealth sections
model.get_radius_dynamics().save_figs({ "angle": 215, "zlabel": "r'", "prefix": "radt" })
Figure 12: Radius dynamics surface
Figure 13: Radius dynamics radius sections
Figure 14: Radius dynamics wealth sections
model.get_wealth_dynamics().save_figs({ "angle": 215, "zlabel": "x'", "prefix": "wltt" })
Figure 15: Wealth dynamics surface
Figure 16: Wealth dynamics radius sections
Figure 17: Wealth dynamics wealth sections
model.save_latex_table("msol.tex")
\begin{figure} \input{../tmp/fig/msol} \end{figure}
Figure 18: Parameterization of dependence analysis
ParameterDependence("delta").save_figs()
Figure 19: Dependence of effort control on δ
Figure 20: Dependence of quantity control on δ
Figure 21: Dependence of value function control on δ
ParameterDependence("alpha").save_figs()
Figure 22: Dependence of effort control on α
Figure 23: Dependence of quantity control on α
Figure 24: Dependence of value function control on α
ParameterDependence("gamma").save_figs()
Figure 25: Dependence of effort control on γ
Figure 26: Dependence of quantity control on γ
Figure 27: Dependence of value function control on γ