- Edoardo Falchi
- Nigar Valiyeva
This project replicates part of the main results from DellaVigna and Pope, 2018, specifically focusing on structural estimates using non linear least squares (NLS). The starting point from which we build upon our codes is the replication of the mentioned paper by Nunnari and Pozzi, 2021 from Bocconi University. Our goal is to improve on that by putting emphasis on programming best-practices and applying concepts learned in the course "Effective Programming Practices for Economists", such as Pytask, Pytest, Estimagic (Gabler, 2021), Sphinx, functional programming and docstrings.
For a local machine to run this project, it needs to have a Python and LaTex distribution. The project was tested on Windows 10 operating system.
The project environment includes all the dependencies needed to run the project.
To run this project in a local machine:
- after cloning the repo, open a terminal in the root directory of the project
and create and activate the environment typing
$ conda env create -f environment.yml
and$ conda activate structural_behavioral_economics_dellavigna_pope_2018_using_estimagic
commands, respectively. - For imports to work, the following command should be typed to the terminal in the root directory of the terminal:
$ conda develop .
- To generate the output files that will be stored in
bld
folder, type$ pytask
in the root directory of your terminal.
This project has been build based on a template by von Gaudecker, 2019.
src
directory includes all the necessary code used in the analysis. To navigate through the folders, the workflow is decomposed as follows:
original_data
contains the original data files used by the original authors, Della Vigna and Pope.data_management
contains the code to clean and for mat the data for the analysis.model_code
contains code for criterion functions used by different optimizers.analysis
includes the code for structural behavioral economics estimation.final
includes code to generate final tables and figures.paper
contains the LaTex files and task to generate the final project paper.documentation
generates pdf and html files for the documentaion of the project code.- The file
test_funcs.py
tests the functions inmodel_code
. - The file
test_nls_data.py
tests the generated data against the data generated by Pozzi and Nunnari.