econ-ark / demark Goto Github PK
View Code? Open in Web Editor NEWDemonstrations of how to use material in the Econ-ARK
Home Page: https://econ-ark.github.io/DemARK/
License: Apache License 2.0
Demonstrations of how to use material in the Econ-ARK
Home Page: https://econ-ark.github.io/DemARK/
License: Apache License 2.0
I doubt that anything would break if we updated the requirement to a later version of matplotlib.
=============================== short test summary info ===============================
FAILED Alternative-Combos-Of-Parameter-Values.ipynb::Cell 0
FAILED Alternative-Combos-Of-Parameter-Values.ipynb::Cell 1
FAILED Alternative-Combos-Of-Parameter-Values.ipynb::Cell 2
FAILED Alternative-Combos-Of-Parameter-Values.ipynb::Cell 3
FAILED Alternative-Combos-Of-Parameter-Values.ipynb::Cell 4
FAILED Alternative-Combos-Of-Parameter-Values.ipynb::Cell 6
FAILED ChangeLiqConstr.ipynb::Cell 0
FAILED ChangeLiqConstr.ipynb::Cell 1
FAILED ChangeLiqConstr.ipynb::Cell 2
FAILED Chinese-Growth.ipynb::Cell 4
FAILED Chinese-Growth.ipynb::Cell 5
FAILED Chinese-Growth.ipynb::Cell 6
FAILED Chinese-Growth.ipynb::Cell 7
FAILED Chinese-Growth.ipynb::Cell 8
FAILED Chinese-Growth.ipynb::Cell 9
FAILED Chinese-Growth.ipynb::Cell 10
FAILED DCEGM-Upper-Envelope.ipynb::Cell 1
FAILED DCEGM-Upper-Envelope.ipynb::Cell 5
FAILED DCEGM-Upper-Envelope.ipynb::Cell 6
FAILED DCEGM-Upper-Envelope.ipynb::Cell 7
FAILED DCEGM-Upper-Envelope.ipynb::Cell 8
FAILED DCEGM-Upper-Envelope.ipynb::Cell 9
FAILED DCEGM-Upper-Envelope.ipynb::Cell 10
FAILED DCEGM-Upper-Envelope.ipynb::Cell 11
FAILED DCEGM-Upper-Envelope.ipynb::Cell 12
FAILED DCEGM-Upper-Envelope.ipynb::Cell 13
FAILED DCEGM-Upper-Envelope.ipynb::Cell 14
FAILED DCEGM-Upper-Envelope.ipynb::Cell 15
FAILED DCEGM-Upper-Envelope.ipynb::Cell 16
FAILED DCEGM-Upper-Envelope.ipynb::Cell 17
FAILED DiamondOLG.ipynb::Cell 0
FAILED DiamondOLG.ipynb::Cell 3
FAILED FisherTwoPeriod.ipynb::Cell 0
FAILED FisherTwoPeriod.ipynb::Cell 2
FAILED FisherTwoPeriod.ipynb::Cell 3
FAILED FisherTwoPeriod.ipynb::Cell 5
FAILED FisherTwoPeriod.ipynb::Cell 6
FAILED FisherTwoPeriod.ipynb::Cell 8
FAILED FisherTwoPeriod.ipynb::Cell 9
FAILED Gentle-Intro-To-HARK-Buffer-Stock-Model.ipynb::Cell 0
FAILED Gentle-Intro-To-HARK-Buffer-Stock-Model.ipynb::Cell 2
FAILED Gentle-Intro-To-HARK-Buffer-Stock-Model.ipynb::Cell 3
FAILED Gentle-Intro-To-HARK-Buffer-Stock-Model.ipynb::Cell 4
FAILED Gentle-Intro-To-HARK-Buffer-Stock-Model.ipynb::Cell 5
FAILED Gentle-Intro-To-HARK-Buffer-Stock-Model.ipynb::Cell 6
FAILED Gentle-Intro-To-HARK-Buffer-Stock-Model.ipynb::Cell 7
FAILED Gentle-Intro-To-HARK-Buffer-Stock-Model.ipynb::Cell 8
FAILED Gentle-Intro-To-HARK-Buffer-Stock-Model.ipynb::Cell 9
FAILED Gentle-Intro-To-HARK-Buffer-Stock-Model.ipynb::Cell 10
FAILED Gentle-Intro-To-HARK-Buffer-Stock-Model.ipynb::Cell 11
FAILED Gentle-Intro-To-HARK-Buffer-Stock-Model.ipynb::Cell 12
FAILED Gentle-Intro-To-HARK-Buffer-Stock-Model.ipynb::Cell 13
FAILED Gentle-Intro-To-HARK-Buffer-Stock-Model.ipynb::Cell 15
FAILED Gentle-Intro-To-HARK-PerfForesightCRRA.ipynb::Cell 0
FAILED Gentle-Intro-To-HARK-PerfForesightCRRA.ipynb::Cell 1
FAILED Gentle-Intro-To-HARK-PerfForesightCRRA.ipynb::Cell 3
FAILED Gentle-Intro-To-HARK-PerfForesightCRRA.ipynb::Cell 4
FAILED Gentle-Intro-To-HARK-PerfForesightCRRA.ipynb::Cell 5
FAILED Gentle-Intro-To-HARK-PerfForesightCRRA.ipynb::Cell 6
FAILED Gentle-Intro-To-HARK-PerfForesightCRRA.ipynb::Cell 7
FAILED Gentle-Intro-To-HARK-PerfForesightCRRA.ipynb::Cell 8
FAILED Gentle-Intro-To-HARK-PerfForesightCRRA.ipynb::Cell 9
FAILED Gentle-Intro-To-HARK-PerfForesightCRRA.ipynb::Cell 10
FAILED Gentle-Intro-To-HARK-PerfForesightCRRA.ipynb::Cell 11
FAILED IncExpectationExample.ipynb::Cell 0
FAILED IncExpectationExample.ipynb::Cell 1
FAILED IncExpectationExample.ipynb::Cell 4
FAILED IndShockConsumerType.ipynb::Cell 0
FAILED IndShockConsumerType.ipynb::Cell 2
FAILED IndShockConsumerType.ipynb::Cell 3
FAILED IndShockConsumerType.ipynb::Cell 4
FAILED IndShockConsumerType.ipynb::Cell 5
FAILED IndShockConsumerType.ipynb::Cell 6
FAILED IndShockConsumerType.ipynb::Cell 7
FAILED IndShockConsumerType.ipynb::Cell 8
FAILED IndShockConsumerType.ipynb::Cell 9
FAILED IndShockConsumerType.ipynb::Cell 11
FAILED IndShockConsumerType.ipynb::Cell 12
FAILED IndShockConsumerType.ipynb::Cell 14
FAILED KeynesFriedmanModigliani.ipynb::Cell 0
FAILED KeynesFriedmanModigliani.ipynb::Cell 2
FAILED KeynesFriedmanModigliani.ipynb::Cell 3
FAILED KeynesFriedmanModigliani.ipynb::Cell 10
FAILED KeynesFriedmanModigliani.ipynb::Cell 12
FAILED KeynesFriedmanModigliani.ipynb::Cell 13
FAILED LifeCycleModelTheoryVsData.ipynb::Cell 0
FAILED LifeCycleModelTheoryVsData.ipynb::Cell 3
FAILED LifeCycleModelTheoryVsData.ipynb::Cell 4
FAILED LifeCycleModelTheoryVsData.ipynb::Cell 5
FAILED LifeCycleModelTheoryVsData.ipynb::Cell 7
FAILED LifeCycleModelTheoryVsData.ipynb::Cell 8
FAILED LifeCycleModelTheoryVsData.ipynb::Cell 9
FAILED LifeCycleModelTheoryVsData.ipynb::Cell 15
FAILED Micro-and-Macro-Implications-of-Very-Impatient-HHs.ipynb::Cell 0
FAILED Micro-and-Macro-Implications-of-Very-Impatient-HHs.ipynb::Cell 1
FAILED Micro-and-Macro-Implications-of-Very-Impatient-HHs.ipynb::Cell 2
FAILED Micro-and-Macro-Implications-of-Very-Impatient-HHs.ipynb::Cell 3
FAILED Micro-and-Macro-Implications-of-Very-Impatient-HHs.ipynb::Cell 4
FAILED Micro-and-Macro-Implications-of-Very-Impatient-HHs.ipynb::Cell 5
FAILED Micro-and-Macro-Implications-of-Very-Impatient-HHs.ipynb::Cell 6
FAILED Micro-and-Macro-Implications-of-Very-Impatient-HHs.ipynb::Cell 7
FAILED MPC-Out-of-Credit-vs-MPC-Out-of-Income.ipynb::Cell 1
FAILED MPC-Out-of-Credit-vs-MPC-Out-of-Income.ipynb::Cell 2
FAILED MPC-Out-of-Credit-vs-MPC-Out-of-Income.ipynb::Cell 3
FAILED MPC-Out-of-Credit-vs-MPC-Out-of-Income.ipynb::Cell 4
FAILED MPC-Out-of-Credit-vs-MPC-Out-of-Income.ipynb::Cell 5
FAILED MPC-Out-of-Credit-vs-MPC-Out-of-Income.ipynb::Cell 7
FAILED MPC-Out-of-Credit-vs-MPC-Out-of-Income.ipynb::Cell 8
FAILED MPC-Out-of-Credit-vs-MPC-Out-of-Income.ipynb::Cell 10
FAILED Nondurables-During-Great-Recession.ipynb::Cell 0
FAILED Nondurables-During-Great-Recession.ipynb::Cell 2
FAILED Nondurables-During-Great-Recession.ipynb::Cell 3
FAILED Nondurables-During-Great-Recession.ipynb::Cell 4
FAILED Nondurables-During-Great-Recession.ipynb::Cell 9
FAILED PerfForesightCRRA-Approximation.ipynb::Cell 0
FAILED PerfForesightCRRA-Approximation.ipynb::Cell 1
FAILED PerfForesightCRRA-Approximation.ipynb::Cell 2
FAILED PerfForesightCRRA-Approximation.ipynb::Cell 3
FAILED PerfForesightCRRA-Approximation.ipynb::Cell 4
FAILED PerfForesightCRRA-Approximation.ipynb::Cell 5
FAILED PerfForesightCRRA-Approximation.ipynb::Cell 6
FAILED PerfForesightCRRA-Approximation.ipynb::Cell 7
FAILED PerfForesightCRRA-SavingRate.ipynb::Cell 0
FAILED PerfForesightCRRA-SavingRate.ipynb::Cell 1
FAILED Structural-Estimates-From-Empirical-MPCs-Fagereng-et-al.ipynb::Cell 1
FAILED Structural-Estimates-From-Empirical-MPCs-Fagereng-et-al.ipynb::Cell 3
FAILED Structural-Estimates-From-Empirical-MPCs-Fagereng-et-al.ipynb::Cell 6
FAILED Structural-Estimates-From-Empirical-MPCs-Fagereng-et-al.ipynb::Cell 8
FAILED TractableBufferStock-Interactive.ipynb::Cell 0
FAILED TractableBufferStock-Interactive.ipynb::Cell 1
FAILED TractableBufferStock-Interactive.ipynb::Cell 2
FAILED TractableBufferStock-Interactive.ipynb::Cell 3
===================== 132 failed, 66 passed, 1 warning in 42.73s ======================
The following notebooks gives errors (and why) using current master branch.
Alternative Combinations of Parameter Values
- this one has an exercise/interactive notebook as users need to create consumer problems first then run the second cell.
A Gentle Introduction to HARK
- this one also has a small exercise.
IncExpectationExample_Roszypal-Schlafmann
- data not available in the repo, tries to read f = open('/Volumes/Data/Job/Discuss/2018-07_NBER_Behavioral-Macro/cstwMPC/Code/Python/Results/LCbetaPointNetWorthLorenzFig.txt','r') [should be changed]
Structural-Estimates-From-Empirical-MPCs-Fagereng-et-al
- T_kill
referenced before assignment. [Fixed]
The Structural Estimates DemARK is running suspiciously wrong. The checked in version runs for 40 minutes; local it's running for 20 minutes with the following message:
https://gist.github.com/sbenthall/1f16a6764b17024eb3be3dc9a68852c0
There's a warning: "Warning: Maximum number of function evaluations has been exceeded."
This is associated with the underlying scipy.optimize.fmin
method, which has a default "maxfun" argument for maximum function evaluations. This default is being used by the underlying HARK call.
Some ideas:
I'm wondering who has a deep understanding of what this notebook is trying to accomplish such that they can explain what's going on in the Fagereng objective function. The GitHub history indicates that @llorracc and @MridulS are the others who have touched the notebook in the repository.
This breaks with HARK master
After running the first cell of this notebook (KrusslSmith), the matplotlib dont work well.
the first cell is:
def in_ipynb():
try:
if str(type(get_ipython())) == "<class 'ipykernel.zmqshell.ZMQInteractiveShell'>":
return True
else:
return False
except NameError:
return False
if in_ipynb():
# %matplotlib inline generates a syntax error when run from the shell
# so do this instead
get_ipython().run_line_magic('matplotlib', 'inline')
else:
get_ipython().run_line_magic('matplotlib', 'auto')
import matplotlib
import matplotlib.pyplot as plt
matplotlib.rcParams['text.usetex'] = True
import sys
import os
from copy import copy
from HARK.utilities import plotFuncs, plotFuncsDer
then if i try to plot (for example: "fig, ax = plt.subplots()")
i got error (very long):
FileNotFoundError Traceback (most recent call last)
~.conda\envs\econ-ark\lib\site-packages\matplotlib\texmanager.py in _run_checked_subprocess(self, command, tex)
303 cwd=self.texcache,
--> 304 stderr=subprocess.STDOUT)
305 except FileNotFoundError as exc:
~.conda\envs\econ-ark\lib\subprocess.py in check_output(timeout, *popenargs, **kwargs)
394 return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
--> 395 **kwargs).stdout
396
~.conda\envs\econ-ark\lib\subprocess.py in run(input, capture_output, timeout, check, *popenargs, **kwargs)
471
--> 472 with Popen(*popenargs, **kwargs) as process:
473 try:
~.conda\envs\econ-ark\lib\subprocess.py in init(self, args, bufsize, executable, stdin, stdout, stderr, preexec_fn, close_fds, shell, cwd, env, universal_newlines, startupinfo, creationflags, restore_signals, start_new_session, pass_fds, encoding, errors, text)
774 errread, errwrite,
--> 775 restore_signals, start_new_session)
776 except:
~.conda\envs\econ-ark\lib\subprocess.py in _execute_child(self, args, executable, preexec_fn, close_fds, pass_fds, cwd, env, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite, unused_restore_signals, unused_start_new_session)
1177 os.fspath(cwd) if cwd is not None else None,
-> 1178 startupinfo)
1179 finally:
FileNotFoundError: [WinError 2] The system cannot find the file specified
The above exception was the direct cause of the following exception:
RuntimeError Traceback (most recent call last)
~.conda\envs\econ-ark\lib\site-packages\matplotlib\pyplot.py in post_execute()
107 def post_execute():
108 if matplotlib.is_interactive():
--> 109 draw_all()
110
111 # IPython >= 2
~.conda\envs\econ-ark\lib\site-packages\matplotlib_pylab_helpers.py in draw_all(cls, force)
126 for f_mgr in cls.get_all_fig_managers():
127 if force or f_mgr.canvas.figure.stale:
--> 128 f_mgr.canvas.draw_idle()
129
130 atexit.register(Gcf.destroy_all)
~.conda\envs\econ-ark\lib\site-packages\matplotlib\backend_bases.py in draw_idle(self, *args, **kwargs)
1905 if not self._is_idle_drawing:
1906 with self._idle_draw_cntx():
-> 1907 self.draw(*args, **kwargs)
1908
1909 def draw_cursor(self, event):
~.conda\envs\econ-ark\lib\site-packages\matplotlib\backends\backend_agg.py in draw(self)
386 self.renderer = self.get_renderer(cleared=True)
387 with RendererAgg.lock:
--> 388 self.figure.draw(self.renderer)
389 # A GUI class may be need to update a window using this draw, so
390 # don't forget to call the superclass.
~.conda\envs\econ-ark\lib\site-packages\matplotlib\artist.py in draw_wrapper(artist, renderer, *args, **kwargs)
36 renderer.start_filter()
37
---> 38 return draw(artist, renderer, *args, **kwargs)
39 finally:
40 if artist.get_agg_filter() is not None:
~.conda\envs\econ-ark\lib\site-packages\matplotlib\figure.py in draw(self, renderer)
1707 self.patch.draw(renderer)
1708 mimage._draw_list_compositing_images(
-> 1709 renderer, self, artists, self.suppressComposite)
1710
1711 renderer.close_group('figure')
~.conda\envs\econ-ark\lib\site-packages\matplotlib\image.py in _draw_list_compositing_images(renderer, parent, artists, suppress_composite)
133 if not_composite or not has_images:
134 for a in artists:
--> 135 a.draw(renderer)
136 else:
137 # Composite any adjacent images together
~.conda\envs\econ-ark\lib\site-packages\matplotlib\artist.py in draw_wrapper(artist, renderer, *args, **kwargs)
36 renderer.start_filter()
37
---> 38 return draw(artist, renderer, *args, **kwargs)
39 finally:
40 if artist.get_agg_filter() is not None:
~.conda\envs\econ-ark\lib\site-packages\matplotlib\axes_base.py in draw(self, renderer, inframe)
2643 renderer.stop_rasterizing()
2644
-> 2645 mimage._draw_list_compositing_images(renderer, self, artists)
2646
2647 renderer.close_group('axes')
~.conda\envs\econ-ark\lib\site-packages\matplotlib\image.py in _draw_list_compositing_images(renderer, parent, artists, suppress_composite)
133 if not_composite or not has_images:
134 for a in artists:
--> 135 a.draw(renderer)
136 else:
137 # Composite any adjacent images together
~.conda\envs\econ-ark\lib\site-packages\matplotlib\artist.py in draw_wrapper(artist, renderer, *args, **kwargs)
36 renderer.start_filter()
37
---> 38 return draw(artist, renderer, *args, **kwargs)
39 finally:
40 if artist.get_agg_filter() is not None:
~.conda\envs\econ-ark\lib\site-packages\matplotlib\axis.py in draw(self, renderer, *args, **kwargs)
1204 ticks_to_draw = self._update_ticks()
1205 ticklabelBoxes, ticklabelBoxes2 = self._get_tick_bboxes(ticks_to_draw,
-> 1206 renderer)
1207
1208 for tick in ticks_to_draw:
~.conda\envs\econ-ark\lib\site-packages\matplotlib\axis.py in _get_tick_bboxes(self, ticks, renderer)
1149 """Return lists of bboxes for ticks' label1's and label2's."""
1150 return ([tick.label1.get_window_extent(renderer)
-> 1151 for tick in ticks if tick.label1.get_visible()],
1152 [tick.label2.get_window_extent(renderer)
1153 for tick in ticks if tick.label2.get_visible()])
~.conda\envs\econ-ark\lib\site-packages\matplotlib\axis.py in (.0)
1149 """Return lists of bboxes for ticks' label1's and label2's."""
1150 return ([tick.label1.get_window_extent(renderer)
-> 1151 for tick in ticks if tick.label1.get_visible()],
1152 [tick.label2.get_window_extent(renderer)
1153 for tick in ticks if tick.label2.get_visible()])
~.conda\envs\econ-ark\lib\site-packages\matplotlib\text.py in get_window_extent(self, renderer, dpi)
888 raise RuntimeError('Cannot get window extent w/o renderer')
889
--> 890 bbox, info, descent = self._get_layout(self._renderer)
891 x, y = self.get_unitless_position()
892 x, y = self.get_transform().transform_point((x, y))
~.conda\envs\econ-ark\lib\site-packages\matplotlib\text.py in _get_layout(self, renderer)
289 _, lp_h, lp_d = renderer.get_text_width_height_descent(
290 "lp", self._fontproperties,
--> 291 ismath="TeX" if self.get_usetex() else False)
292 min_dy = (lp_h - lp_d) * self._linespacing
293
~.conda\envs\econ-ark\lib\site-packages\matplotlib\backends\backend_agg.py in get_text_width_height_descent(self, s, prop, ismath)
199 fontsize = prop.get_size_in_points()
200 w, h, d = texmanager.get_text_width_height_descent(
--> 201 s, fontsize, renderer=self)
202 return w, h, d
203
~.conda\envs\econ-ark\lib\site-packages\matplotlib\texmanager.py in get_text_width_height_descent(self, tex, fontsize, renderer)
446 else:
447 # use dviread. It sometimes returns a wrong descent.
--> 448 dvifile = self.make_dvi(tex, fontsize)
449 with dviread.Dvi(dvifile, 72 * dpi_fraction) as dvi:
450 page, = dvi
~.conda\envs\econ-ark\lib\site-packages\matplotlib\texmanager.py in make_dvi(self, tex, fontsize)
336 self._run_checked_subprocess(
337 ["latex", "-interaction=nonstopmode", "--halt-on-error",
--> 338 texfile], tex)
339 for fname in glob.glob(basefile + '*'):
340 if not fname.endswith(('dvi', 'tex')):
~.conda\envs\econ-ark\lib\site-packages\matplotlib\texmanager.py in _run_checked_subprocess(self, command, tex)
306 raise RuntimeError(
307 'Failed to process string with tex because {} could not be '
--> 308 'found'.format(command[0])) from exc
309 except subprocess.CalledProcessError as exc:
310 raise RuntimeError(
RuntimeError: Failed to process string with tex because latex could not be found
FileNotFoundError Traceback (most recent call last)
~.conda\envs\econ-ark\lib\site-packages\matplotlib\texmanager.py in _run_checked_subprocess(self, command, tex)
303 cwd=self.texcache,
--> 304 stderr=subprocess.STDOUT)
305 except FileNotFoundError as exc:
~.conda\envs\econ-ark\lib\subprocess.py in check_output(timeout, *popenargs, **kwargs)
394 return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
--> 395 **kwargs).stdout
396
~.conda\envs\econ-ark\lib\subprocess.py in run(input, capture_output, timeout, check, *popenargs, **kwargs)
471
--> 472 with Popen(*popenargs, **kwargs) as process:
473 try:
~.conda\envs\econ-ark\lib\subprocess.py in init(self, args, bufsize, executable, stdin, stdout, stderr, preexec_fn, close_fds, shell, cwd, env, universal_newlines, startupinfo, creationflags, restore_signals, start_new_session, pass_fds, encoding, errors, text)
774 errread, errwrite,
--> 775 restore_signals, start_new_session)
776 except:
~.conda\envs\econ-ark\lib\subprocess.py in _execute_child(self, args, executable, preexec_fn, close_fds, pass_fds, cwd, env, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite, unused_restore_signals, unused_start_new_session)
1177 os.fspath(cwd) if cwd is not None else None,
-> 1178 startupinfo)
1179 finally:
FileNotFoundError: [WinError 2] The system cannot find the file specified
The above exception was the direct cause of the following exception:
RuntimeError Traceback (most recent call last)
~.conda\envs\econ-ark\lib\site-packages\IPython\core\formatters.py in call(self, obj)
339 pass
340 else:
--> 341 return printer(obj)
342 # Finally look for special method names
343 method = get_real_method(obj, self.print_method)
~.conda\envs\econ-ark\lib\site-packages\IPython\core\pylabtools.py in (fig)
242
243 if 'png' in formats:
--> 244 png_formatter.for_type(Figure, lambda fig: print_figure(fig, 'png', **kwargs))
245 if 'retina' in formats or 'png2x' in formats:
246 png_formatter.for_type(Figure, lambda fig: retina_figure(fig, **kwargs))
~.conda\envs\econ-ark\lib\site-packages\IPython\core\pylabtools.py in print_figure(fig, fmt, bbox_inches, **kwargs)
126
127 bytes_io = BytesIO()
--> 128 fig.canvas.print_figure(bytes_io, **kw)
129 data = bytes_io.getvalue()
130 if fmt == 'svg':
~.conda\envs\econ-ark\lib\site-packages\matplotlib\backend_bases.py in print_figure(self, filename, dpi, facecolor, edgecolor, orientation, format, bbox_inches, **kwargs)
2054 orientation=orientation,
2055 dryrun=True,
-> 2056 **kwargs)
2057 renderer = self.figure._cachedRenderer
2058 bbox_artists = kwargs.pop("bbox_extra_artists", None)
~.conda\envs\econ-ark\lib\site-packages\matplotlib\backends\backend_agg.py in print_png(self, filename_or_obj, metadata, pil_kwargs, *args, **kwargs)
525
526 else:
--> 527 FigureCanvasAgg.draw(self)
528 renderer = self.get_renderer()
529 with cbook._setattr_cm(renderer, dpi=self.figure.dpi), \
~.conda\envs\econ-ark\lib\site-packages\matplotlib\backends\backend_agg.py in draw(self)
386 self.renderer = self.get_renderer(cleared=True)
387 with RendererAgg.lock:
--> 388 self.figure.draw(self.renderer)
389 # A GUI class may be need to update a window using this draw, so
390 # don't forget to call the superclass.
~.conda\envs\econ-ark\lib\site-packages\matplotlib\artist.py in draw_wrapper(artist, renderer, *args, **kwargs)
36 renderer.start_filter()
37
---> 38 return draw(artist, renderer, *args, **kwargs)
39 finally:
40 if artist.get_agg_filter() is not None:
~.conda\envs\econ-ark\lib\site-packages\matplotlib\figure.py in draw(self, renderer)
1707 self.patch.draw(renderer)
1708 mimage._draw_list_compositing_images(
-> 1709 renderer, self, artists, self.suppressComposite)
1710
1711 renderer.close_group('figure')
~.conda\envs\econ-ark\lib\site-packages\matplotlib\image.py in _draw_list_compositing_images(renderer, parent, artists, suppress_composite)
133 if not_composite or not has_images:
134 for a in artists:
--> 135 a.draw(renderer)
136 else:
137 # Composite any adjacent images together
~.conda\envs\econ-ark\lib\site-packages\matplotlib\artist.py in draw_wrapper(artist, renderer, *args, **kwargs)
36 renderer.start_filter()
37
---> 38 return draw(artist, renderer, *args, **kwargs)
39 finally:
40 if artist.get_agg_filter() is not None:
~.conda\envs\econ-ark\lib\site-packages\matplotlib\axes_base.py in draw(self, renderer, inframe)
2643 renderer.stop_rasterizing()
2644
-> 2645 mimage._draw_list_compositing_images(renderer, self, artists)
2646
2647 renderer.close_group('axes')
~.conda\envs\econ-ark\lib\site-packages\matplotlib\image.py in _draw_list_compositing_images(renderer, parent, artists, suppress_composite)
133 if not_composite or not has_images:
134 for a in artists:
--> 135 a.draw(renderer)
136 else:
137 # Composite any adjacent images together
~.conda\envs\econ-ark\lib\site-packages\matplotlib\artist.py in draw_wrapper(artist, renderer, *args, **kwargs)
36 renderer.start_filter()
37
---> 38 return draw(artist, renderer, *args, **kwargs)
39 finally:
40 if artist.get_agg_filter() is not None:
~.conda\envs\econ-ark\lib\site-packages\matplotlib\axis.py in draw(self, renderer, *args, **kwargs)
1204 ticks_to_draw = self._update_ticks()
1205 ticklabelBoxes, ticklabelBoxes2 = self._get_tick_bboxes(ticks_to_draw,
-> 1206 renderer)
1207
1208 for tick in ticks_to_draw:
~.conda\envs\econ-ark\lib\site-packages\matplotlib\axis.py in _get_tick_bboxes(self, ticks, renderer)
1149 """Return lists of bboxes for ticks' label1's and label2's."""
1150 return ([tick.label1.get_window_extent(renderer)
-> 1151 for tick in ticks if tick.label1.get_visible()],
1152 [tick.label2.get_window_extent(renderer)
1153 for tick in ticks if tick.label2.get_visible()])
~.conda\envs\econ-ark\lib\site-packages\matplotlib\axis.py in (.0)
1149 """Return lists of bboxes for ticks' label1's and label2's."""
1150 return ([tick.label1.get_window_extent(renderer)
-> 1151 for tick in ticks if tick.label1.get_visible()],
1152 [tick.label2.get_window_extent(renderer)
1153 for tick in ticks if tick.label2.get_visible()])
~.conda\envs\econ-ark\lib\site-packages\matplotlib\text.py in get_window_extent(self, renderer, dpi)
888 raise RuntimeError('Cannot get window extent w/o renderer')
889
--> 890 bbox, info, descent = self._get_layout(self._renderer)
891 x, y = self.get_unitless_position()
892 x, y = self.get_transform().transform_point((x, y))
~.conda\envs\econ-ark\lib\site-packages\matplotlib\text.py in _get_layout(self, renderer)
289 _, lp_h, lp_d = renderer.get_text_width_height_descent(
290 "lp", self._fontproperties,
--> 291 ismath="TeX" if self.get_usetex() else False)
292 min_dy = (lp_h - lp_d) * self._linespacing
293
~.conda\envs\econ-ark\lib\site-packages\matplotlib\backends\backend_agg.py in get_text_width_height_descent(self, s, prop, ismath)
199 fontsize = prop.get_size_in_points()
200 w, h, d = texmanager.get_text_width_height_descent(
--> 201 s, fontsize, renderer=self)
202 return w, h, d
203
~.conda\envs\econ-ark\lib\site-packages\matplotlib\texmanager.py in get_text_width_height_descent(self, tex, fontsize, renderer)
446 else:
447 # use dviread. It sometimes returns a wrong descent.
--> 448 dvifile = self.make_dvi(tex, fontsize)
449 with dviread.Dvi(dvifile, 72 * dpi_fraction) as dvi:
450 page, = dvi
~.conda\envs\econ-ark\lib\site-packages\matplotlib\texmanager.py in make_dvi(self, tex, fontsize)
336 self._run_checked_subprocess(
337 ["latex", "-interaction=nonstopmode", "--halt-on-error",
--> 338 texfile], tex)
339 for fname in glob.glob(basefile + '*'):
340 if not fname.endswith(('dvi', 'tex')):
~.conda\envs\econ-ark\lib\site-packages\matplotlib\texmanager.py in _run_checked_subprocess(self, command, tex)
306 raise RuntimeError(
307 'Failed to process string with tex because {} could not be '
--> 308 'found'.format(command[0])) from exc
309 except subprocess.CalledProcessError as exc:
310 raise RuntimeError(
RuntimeError: Failed to process string with tex because latex could not be found
I wanted to make issue in DemARK for the version control and dependency issues of this repository.
This can extend the conversation here:
econ-ark/HARK#527 (comment)
The question is: what happens when a change to HARK master
would break a DemARK?
Micro-and-Macro-Implications-of-Very-Impatient-HHs
# Plot Lorenz curves for model with uniform distribution of time preference
from HARK.cstwMPC.SetupParamsCSTW import SCF_wealth, SCF_weights
from HARK.utilities import getLorenzShares, getPercentiles
pctiles = np.linspace(0.001,0.999,200)
sim_wealth = np.concatenate([ThisType.aLvlNow for ThisType in MyTypes])
SCF_Lorenz_points = getLorenzShares(SCF_wealth,weights=SCF_weights,percentiles=pctiles)
sim_Lorenz_points = getLorenzShares(sim_wealth,percentiles=pctiles)
plt.plot(pctiles,SCF_Lorenz_points,'--k')
plt.plot(pctiles,sim_Lorenz_points,'-b')
plt.xlabel('Percentile of net worth')
plt.ylabel('Cumulative share of wealth')
plt.show(block=False)
---------------------------------------------------------------------------
FileNotFoundError Traceback (most recent call last)
<ipython-input-6-20e277edf0ec> in <module>
1 # Plot Lorenz curves for model with uniform distribution of time preference
----> 2 from HARK.cstwMPC.SetupParamsCSTW import SCF_wealth, SCF_weights
3 from HARK.utilities import getLorenzShares, getPercentiles
4
5 pctiles = np.linspace(0.001,0.999,200)
/dhlib/lib/python3.7/site-packages/HARK/cstwMPC/SetupParamsCSTW.py in <module>
115 # Import survival probabilities from SSA data
116 data_location = os.path.dirname(os.path.abspath(__file__))
--> 117 f = open(data_location + '/' + 'USactuarial.txt','r')
118 actuarial_reader = csv.reader(f,delimiter='\t')
119 raw_actuarial = list(actuarial_reader)
FileNotFoundError: [Errno 2] No such file or directory: '/dhlib/lib/python3.7/site-packages/HARK/cstwMPC/USactuarial.txt'
$ ipython KrusellSmith.py
Using matplotlib backend: Qt5Agg
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
~/projects/econ-ark/DemARK/notebooks/KrusellSmith.py in <module>
214 "PermGroFac" : [1.0], # Permanent income growth factor
215 # New Parameters that we need now
--> 216 'MgridBase': np.array([0.1,0.3,0.6,
217 0.8,0.9,0.98,
218 1.0,1.02,1.1,
NameError: name 'np' is not defined
econ-ark/HARK#442 has put code from HARK.cstwMPC into examples and hence broken the import structure, as discussed before the DemARKs depending on them should be moved to examples.
The DCEGM notebook should import all of its tool from the dcegm library
The Uncertainty and the Savings Rate
DemARK depends on HARK.cstwMPC
code, and not just on the dataset.
This HARK.cstwMPC
code has a nonstandard way of representing shock distributions (i.e., not as a list, even when an infinite horizon is used) that is incompatible with recent revisions to the HARK distribution handling code that's being included in version 0.10.6
This DemARK will soon be pulled out of master
because it fails when run.
This issue is for getting it working again once an updated and stable cstwMPC version is available.
Take the DCT Illustration materials from the BayerLuetticke REMARK and make it into a DemARK
This follows:
econ-ark/REMARK#47
Structural-Estimates-From-Empirical-MPCs-Fagereng-et-al
# Import needed tools from HARK
from HARK.utilities import approxUniform, getPercentiles
from HARK.parallel import multiThreadCommands
from HARK.estimation import minimizeNelderMead
from HARK.ConsumptionSaving.ConsIndShockModel import *
from HARK.cstwMPC.SetupParamsCSTW import init_infinite
---------------------------------------------------------------------------
FileNotFoundError Traceback (most recent call last)
<ipython-input-2-3fc2b9f99f07> in <module>
5 from HARK.estimation import minimizeNelderMead
6 from HARK.ConsumptionSaving.ConsIndShockModel import *
----> 7 from HARK.cstwMPC.SetupParamsCSTW import init_infinite
/dhlib/lib/python3.7/site-packages/HARK/cstwMPC/SetupParamsCSTW.py in <module>
115 # Import survival probabilities from SSA data
116 data_location = os.path.dirname(os.path.abspath(__file__))
--> 117 f = open(data_location + '/' + 'USactuarial.txt','r')
118 actuarial_reader = csv.reader(f,delimiter='\t')
119 raw_actuarial = list(actuarial_reader)
FileNotFoundError: [Errno 2] No such file or directory: '/dhlib/lib/python3.7/site-packages/HARK/cstwMPC/USactuarial.txt'
Per discussions on issue #43 and PR #50, the only way to have multiple notebooks in a repository that use different versions of HARK is to add a cell to the top of the notebooks installing the desired version, which would look something like:
%%capture
! pip install econ-ark==0.10.whatever
(The %%capture
is there to prevent the installation's progress from displaying within the notebook -- it suppresses all output.)
Once we do this, we can set the default in the repository to be the latest stable release. Any notebooks that are not "finished" and pinned to an older version will automatically be updated to the new release, and we can test them when that happens.
NameError Traceback (most recent call last)
~/projects/econ-ark/DemARK/notebooks/ChangeLiqConstr.py in
70 # + {"collapsed": true}
71 # Make a copy of the example consumer
---> 72 KinkyExampleTighten = deepcopy(KinkyExample)
73
74 # Now change the location of the borrowing constraint -- the consumer cannot borrow more than 0.2
NameError: name 'deepcopy' is not defined
$ ipython Chinese-Growth.py
100%|โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ| 5/5 [02:18<00:00, 27.75s/it]
(econ-ark) sb@nothingness:~/projects/econ-ark/DemARK/notebooks$ ipython ConsPortfolioModelDoc.py
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
~/projects/econ-ark/DemARK/notebooks/ConsPortfolioModelDoc.py in <module>
142 plt.axhline(lnpcct.MertSamCampVicShare, c='r')
143 plt.ylim(0,1.05)
--> 144 plt.text((aMax-aMin)/4,lnpcct.MertSamCampVicShare-0.1,r'$\uparrow $ limit as $m \uparrow \infty$',fontsize = 22,fontweight='bold')
145 plt.show()
146
~/.virtualenvs/econ-ark/lib/python3.7/site-packages/matplotlib/pyplot.py in text(x, y, s, fontdict, withdash, **kwargs)
2961 x, y, s, fontdict=None,
2962 withdash=cbook.deprecation._deprecated_parameter, **kwargs):
-> 2963 return gca().text(x, y, s, fontdict=fontdict, withdash=withdash, **kwargs)
2964
2965
TypeError: text() missing 1 required positional argument: 's'
@llorracc says here: econ-ark/HARK#472 (comment)
While we're at it, though, let's change the name of
"TractableBufferStockQuickDemo" to "TractableBufferStock-Interactive" or
something like that. (Open it and you'll see why).
I'm trying to update the DemARKs to make them work with the most recent HARK release.
I'm confused by something in this notebook and I wonder if somebody could explain what's going on:
https://github.com/econ-ark/DemARK/blob/master/notebooks/LifeCycleModelTheoryVsData.ipynb
These are the tracked variables on LifecyclePop:
LifeCyclePop.track_vars = ['aNrmNow','pLvlNow','mNrmNow','cNrmNow','TranShkNow']
But in cell [9] there is the expression:
aGro41=LifeCyclePop.aLvlNow_hist[41]/LifeCyclePop.aLvlNow_hist[40]
How could that cell have been evaluated, if aLvlNow was not a tracked variable?
"EGM" stands for "endogenous grid method"
notebooks/HoweWeSolveIndShockConsumerType.py uses this acronym without defining it.
One has to look around in other notebooks to find a link to the canonical resource.
http://www.econ2.jhu.edu/people/ccarroll/EndogenousGridpoints.pdf
Colleagues,
This might be very basic issue. But suddenly I could not import HARK correctly. When I run codes including lines such as
from HARK.utilities import plotFuncs, plotFuncsDer
I was told
No module named HARK.
I checked conda list
and econ-ark is there. I also updated all the packages. I used conda-forge to reinstall it and the issue remains.
So what might be the problem? Thanks.
Updates to Gentle-Intro-To-HARK-Buffer-Stock-Model to make it more about HARK's solution internals.
Look at how to combine these two introductory notebooks:
Then move these into HARK/examples after econ-ark/HARK#442 is merged as part of econ-ark/HARK#459
I get a warning message when I run a cell below.
# Put all agents into the economy
KSEconomy_sim = CobbDouglasMarkovEconomy(agents = MyTypes, **KSEconomyDictionary)
KSEconomy_sim.AggShkDstn = KSAggShkDstn # Agg shocks are the same as defined earlier
for ThisType in MyTypes:
ThisType.getEconomyData(KSEconomy_sim) # Makes attributes of the economy, attributes of the agent
KSEconomy_sim.makeAggShkHist() # Make a simulated prehistory of the economy
KSEconomy_sim.solve() # Solve macro problem by getting a fixed point dynamic r
--------------------------------------------------------------------------------
**** WARNING: could not execute multiThreadCommands in HARK.core.Market.solveAgents() so using the serial version instead. This will likely be slower. The multiTreadCommands() functions failed with the following error:
<class 'AttributeError'> : Can't pickle local object 'CobbDouglasEconomy.update.<locals>.<lambda>'
We've moved to python 3 as the default, and do not want to guarantee that future content will work on both py27 and py3. Need to:
Can you take this on?
I haven't tried the other notebooks, but I'm getting a 404 error when launching the first part of Gentle Intro.
Should we just pin this demark to work with 0.10.6 or try to make it work by import the REMARK?
# Construct the economy, make an initial history, then solve
KSAgent.getEconomyData(KSEconomy) # Makes attributes of the economy, attributes of the agent
KSEconomy.makeAggShkHist() # Make a simulated history of the economy
# Solve macro problem by finding a fixed point for beliefs
KSEconomy.solve() # Solve the economy using the market method.
# i.e. guess the saving function, and iterate until a fixed point
The FashionVictim DEMARK imports code from HARK
:
https://github.com/econ-ark/DemARK/blob/master/notebooks/Fashion-Victim-Model.py#L52
After this, it appears to execute the exact same code that is in the Fashion-Victim-Model main()
method:
https://github.com/econ-ark/DemARK/blob/master/notebooks/Fashion-Victim-Model.py#L123
https://github.com/econ-ark/HARK/blob/master/HARK/FashionVictim/FashionVictimModel.py#L414
In other words, this DEMARK is just a duplicate of what's in HARK, with some copy-and-pasted code.
FashionVictim is slated to be taken out of the HARK source library and into a HARK examples/
directory.
econ-ark/HARK#440
It has been argued that since FashionVictim is really a kind of tutorial documentation, not material for economics students, it's better for it to be in examples/
than to be a DemARK.
Either:
econ-ark
dependency should be pegged to version 0.10.2 so this DemARK can keep depending on HARK.If we decide on the latter for some reason, I hope we put some thought into how to design this better to avoid code duplication across repositories.
$ ipython GenIncProcessModel.py
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
~/projects/econ-ark/DemARK/notebooks/GenIncProcessModel.py in <module>
178 # More parameters specific to "Explicit Permanent income" shock model
179 "cycles": 0,
--> 180 "pLvlPctiles" : np.concatenate(([0.001, 0.005, 0.01, 0.03], np.linspace(0.05, 0.95, num=19),[0.97, 0.99, 0.995, 0.999])),
181 "PermGroFac" : [1.0], # Permanent income growth factor - long run permanent income growth doesn't work yet
182 }
NameError: name 'np' is not defined
Uncertainty-and-the-Saving-Rate
# Import HARK tools and cstwMPC parameter values
from HARK.utilities import plotFuncsDer, plotFuncs
from HARK.ConsumptionSaving.ConsIndShockModel import PerfForesightConsumerType
import HARK.cstwMPC.cstwMPC as cstwMPC
import HARK.cstwMPC.SetupParamsCSTW as Params
# Double the default value of variance
# Params.init_infinite['PermShkStd'] = [i*2 for i in Params.init_infinite['PermShkStd']]
---------------------------------------------------------------------------
FileNotFoundError Traceback (most recent call last)
<ipython-input-2-44cd4d7f756e> in <module>
2 from HARK.utilities import plotFuncsDer, plotFuncs
3 from HARK.ConsumptionSaving.ConsIndShockModel import PerfForesightConsumerType
----> 4 import HARK.cstwMPC.cstwMPC as cstwMPC
5 import HARK.cstwMPC.SetupParamsCSTW as Params
6
/dhlib/lib/python3.7/site-packages/HARK/cstwMPC/cstwMPC.py in <module>
17 from HARK.simulation import drawDiscrete
18 from HARK import Market
---> 19 import HARK.cstwMPC.SetupParamsCSTW as Params
20 import HARK.ConsumptionSaving.ConsIndShockModel as Model
21 from HARK.ConsumptionSaving.ConsAggShockModel import CobbDouglasEconomy, AggShockConsumerType
/dhlib/lib/python3.7/site-packages/HARK/cstwMPC/SetupParamsCSTW.py in <module>
115 # Import survival probabilities from SSA data
116 data_location = os.path.dirname(os.path.abspath(__file__))
--> 117 f = open(data_location + '/' + 'USactuarial.txt','r')
118 actuarial_reader = csv.reader(f,delimiter='\t')
119 raw_actuarial = list(actuarial_reader)
FileNotFoundError: [Errno 2] No such file or directory: '/dhlib/lib/python3.7/site-packages/HARK/cstwMPC/USactuarial.txt'
I just encountered the problem that if I want to use the installed version of HARK instead of the cloned version, then I have to change the module name in the site-packages folder to 'HARK' as mac is case sensitive and the module is installed as 'hark'.
When this is not done, I had an ModuleNotFoundError.
I am not sure whether this is my own problem or not, just in case someone has the same problem with me.
The path of my module is /Users/username/anaconda3/lib/python3.7/site-packages/hark, changing 'hark' to 'HARK' resolve the problem.
in
aLvlGroNow = np.log(LifeCyclePop.aNrmNow_hist[t]/LifeCyclePop.aNrmNow_hist[t-1]) # (10000,)
aNrmNow_hist
should be the level
Alternative Combos of Parameter Values
for ThisType in log_progress(MyTypes, every=1):
ThisType.solve()
ThisType.initializeSim()
ThisType.simulate()
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-4-942bd40b6b01> in <module>
----> 1 for ThisType in log_progress(MyTypes, every=1):
2 ThisType.solve()
3 ThisType.initializeSim()
4 ThisType.simulate()
NameError: name 'MyTypes' is not defined
Gentle Intro to HARK PerfForesightCRRA
# YOUR FIRST HANDS-ON EXERCISE!
# Fill in the value for "mPlotBottom" to plot the consumption function from the point where it is zero.
plotFuncs(PFexample.solution[0].cFunc,mPlotBottom,mPlotTop)
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-9-3fb1a293d95e> in <module>
1 # YOUR FIRST HANDS-ON EXERCISE!
2 # Fill in the value for "mPlotBottom" to plot the consumption function from the point where it is zero.
----> 3 plotFuncs(PFexample.solution[0].cFunc,mPlotBottom,mPlotTop)
NameError: name 'mPlotBottom' is not defined
# YOUR FIRST HANDS-ON EXERCISE!
# Fill in the value for "mPlotBottom" to plot the consumption function from the point where it is zero.
plotFuncs(PFexample.solution[0].cFunc,mPlotBottom,mPlotTop)
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-9-3fb1a293d95e> in <module>
1 # YOUR FIRST HANDS-ON EXERCISE!
2 # Fill in the value for "mPlotBottom" to plot the consumption function from the point where it is zero.
----> 3 plotFuncs(PFexample.solution[0].cFunc,mPlotBottom,mPlotTop)
NameError: name 'mPlotBottom' is not defined
Micro and Macro Implications of Very Impatient HHs
# Retrieve the MPC's
percentiles=np.linspace(0.1,0.9,9)
MPC_sim = np.concatenate([ThisType.MPCnow for ThisType in MyTypes])
MPCpercentiles_quarterly = getPercentiles(MPC_sim,percentiles=percentiles)
MPCpercentiles_annual = 1.0 - (1.0 - MPCpercentiles_quarterly)**4
print('The MPC at the 10th percentile of the distribution is '+str(decfmt2(MPCpercentiles_annual[0])))
print('The MPC at the 50th percentile of the distribution is '+str(decfmt2(MPCpercentiles_annual[4])))
print('The MPC at the 90th percentile of the distribution is '+str(decfmt2(MPCpercentiles_annual[-1])))
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-7-31e0bf7626bb> in <module>
2 percentiles=np.linspace(0.1,0.9,9)
3 MPC_sim = np.concatenate([ThisType.MPCnow for ThisType in MyTypes])
----> 4 MPCpercentiles_quarterly = getPercentiles(MPC_sim,percentiles=percentiles)
5 MPCpercentiles_annual = 1.0 - (1.0 - MPCpercentiles_quarterly)**4
6
NameError: name 'getPercentiles' is not defined
I loaded the jupyter notebook from binder (follow this link: https://mybinder.org/v2/gh/econ-ark/DemARK/master?filepath=notebooks/Micro-and-Macro-Implications-of-Very-Impatient-HHs-Problems.ipynb).
But when i try to run the notebook in my laptop i got the error: "ModuleNotFoundError: No module named 'util' "
The first "assignment" notebook was corrupted with merge conflict notations on the commit entitled "Micro-and-Macro update". I suggest we roll back that commit.
Several of our notebooks (such as those listed in #37 and #38) require changes from users to run correctly. This can be confusing for people not coming to the notebooks in the context of a class or workshop. How can we more clearly label which notebooks are expected to break if run immediately upon loading?
As happen in KrasellSmith in the first cell (see issue #55) code:
matplotlib.rcParams['text.usetex'] = True
$ ipython KeynesFriedmanModigliani.py
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
~/projects/econ-ark/DemARK/notebooks/KeynesFriedmanModigliani.py in <module>
31 import datetime as dt
32 import scipy.stats as stats
---> 33 import statsmodels.formula.api as sm
34 from copy import deepcopy
35
ModuleNotFoundError: No module named 'statsmodels'
# Initial imports and notebook setup, click arrow to show
import HARK.ConsumptionSaving.ConsIndShockModel as Model # The consumption-saving micro model
import HARK.SolvingMicroDSOPs.EstimationParameters as Params # Parameters for the consumer type and the estimation
from HARK.utilities import plotFuncsDer, plotFuncs # Some tools
import numpy as np
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-1-d26969f29899> in <module>
2
3 import HARK.ConsumptionSaving.ConsIndShockModel as Model # The consumption-saving micro model
----> 4 import HARK.SolvingMicroDSOPs.EstimationParameters as Params # Parameters for the consumer type and the estimation
5 from HARK.utilities import plotFuncsDer, plotFuncs # Some tools
6
ModuleNotFoundError: No module named 'HARK.SolvingMicroDSOPs.EstimationParameters'
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-2-0734f7422d0c> in <module>
1 # Set up default values for CRRA, DiscFac, and simulation variables in the dictionary
----> 2 Params.init_consumer_objects["CRRA"]= 2.00 # Default coefficient of relative risk aversion (rho)
3 Params.init_consumer_objects["DiscFac"]= 0.97 # Default intertemporal discount factor (beta)
4 Params.init_consumer_objects["PermGroFacAgg"]= 1.0 # Aggregate permanent income growth factor
5 Params.init_consumer_objects["aNrmInitMean"]= -10.0 # Mean of log initial assets
NameError: name 'Params' is not defined
Gentle Intro to HARK-PerfForesightCRRA
# Revert NewExample's discount factor and make his future income minuscule
your lines here!
# Compare the old and new consumption functions
plotFuncs([PFexample.solution[0].cFunc,NewExample.solution[0].cFunc],0.,10.)
File "<ipython-input-12-a1f0e735300d>", line 2
your lines here!
^
SyntaxError: invalid syntax
There are a few stray files in the DemARK directory which should not be there.
The cstwMPC implementation in HARK is deprecated:
econ-ark/HARK#449
This means that it is not being maintained in its current form.
But some DemARKs depend on this code in HARK. These DemARKs are:
$ ipython Alternative-Combos-Of-Parameter-Values.py
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
~/projects/econ-ark/DemARK/notebooks/Alternative-Combos-Of-Parameter-Values.py in <module>
114
115 # + {"collapsed": true}
--> 116 for ThisType in tqdm(MyTypes):
117 ThisType.solve()
118 ThisType.initializeSim()
NameError: name 'MyTypes' is not defined
Gentle-Intro-To-HARK-PerfForesightCRRA
# YOUR FIRST HANDS-ON EXERCISE!
# Fill in the value for "mPlotBottom" to plot the consumption function from the point where it is zero.
plotFuncs(PFexample.solution[0].cFunc,mPlotBottom,mPlotTop)
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-9-3fb1a293d95e> in <module>
1 # YOUR FIRST HANDS-ON EXERCISE!
2 # Fill in the value for "mPlotBottom" to plot the consumption function from the point where it is zero.
----> 3 plotFuncs(PFexample.solution[0].cFunc,mPlotBottom,mPlotTop)
NameError: name 'mPlotBottom' is not defined
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.