Twenty-two Jupyter notebooks that demonstrate HARK, the Econ-ARK toolkit, building consumption and saving models one assumption at a time, from a two-period problem to a life cycle with uninsurable risk. Read them at econ-ark.github.io/DemARK, where each page can start a Binder session and run its own cells, or install them below and run them locally.
Every notebook is meant to be run and edited. They need Python 3.12 or later.
- Install uv
- Clone this repository
uv sync --extra devuv run jupyter lab- Open a notebook and choose
Kernel -> Restart & Run All
The dev extra brings in the released econ-ark from PyPI along with JupyterLab and the test
tools. It is the quickest path.
- Install Miniconda
- Clone this repository
conda env create -f binder/environment.yml, orconda env update -f binder/environment.ymlif you already have aDemARKenvironmentconda activate DemARKconda install jupyterlab- Run
jupyter labfrom the repository root - Open a notebook and choose
Kernel -> Restart & Run All
binder/environment.yml installs HARK from its main branch, so this path, Binder and the build
badge above all exercise the notebooks against HARK under development. Where a notebook behaves
differently across the two install paths, the uv one is the released behaviour.
- Install Docker
- Install
repo2dockerwith its install-from-source instructions jupyter repo2docker https://github.com/econ-ark/DemARK- Follow the link your terminal prints to the running Jupyter instance
- Open a notebook and choose
Kernel -> Restart & Run All
New notebooks and edits to existing ones are equally welcome, both as pull requests. A new notebook
should run top to bottom from a fresh kernel, which is what a reader does first and what CI does to
all but two of them: build.yml runs nbval over notebooks/ and skips Chinese-Growth and
Harmenberg-Aggregation, whose run times exceed what a CI job allows. Those two are checked by
hand, so a change to either needs a local run. For anything that is not a change to the notebooks,
please open an issue.
With write access to this repository, open the
most recent build run and press
Re-run all jobs. This runs twenty of the twenty-two notebooks, the two long ones above excepted,
against the current development version of HARK, which is how a break in HARK main is caught here
before a release.