# paste the deaton class code here
# alternatively (and this is a better option) create file deaton.py in the same directory, paste the code there, and include it using "import * from deaton.py" command
Make sure the code from the lecture runs and produces the same output
m = deaton(ngrid=100,nchgrid=250,sigma=.5,nquad=10, bellman_type='continuous')
print(m)
v,c = m.solve_plot(solver='timeiter')
m.accuracy(verbose=True)
sims = m.simulator(init_wealth=m.Mbar*np.arange(15)/15,T=25,seed=2020)
v,c = m.solve_plot(solver='vfi')
m.accuracy(verbose=True)
sims = m.simulator(init_wealth=m.Mbar*np.arange(15)/15,T=25,seed=2020)
m.bellman_type='discretized'
v,c = m.solve_plot(solver='vfi')
m.accuracy(verbose=True)
sims = m.simulator(init_wealth=m.Mbar*np.arange(15)/15,T=25,seed=2020)
Consider the three solution methods above:
Choose parametrization for the test model, compute the accuracy measure for each method.
Then, by changing various (technical) parameters of the model, for each of the three methods, choose one parameter that influences the accuracy of that method the most.
Finally, make a plot to visualize the trade-off between accuracy and run time. It should have run time on vertical axis and accuracy measure on the horizontal axis. Three curves should correspond to the three solution methods, and should be composed on the points obtained for different settings identified as important factors influencing the accuracy for each method.
Make the plot look good and be easy to read.
# Write your code here