This repo contains the code required to reproduce the figures in the UBI Center Blank Slate UBI report.
Dependencies:
conda env create -f environment.yml
from within the cloned directory
conda activate uk
You can now recreate our results. The main calculations can be performed like so:
python py/run_optimisation.py
and wait
optimal_params.csv
.You can recreate our summary tables with:
python py/summary_tables.py
And our tables and figures with the jupyter
notebook jb/uk_ft_ubi.ipynb
. To use the notebook you will need to install a few more packages:
pip install "git+https://github.com/UBICenter/ubicenter.py@5acc40c70b5495f634c2d18399db22f04603a4b1"
conda install -c plotly plotly-orca
Then run jupyter notebook
, open the notebook and run its cells.
Note also that some of the marginal tax rate cells at the bottom of the notebook will not run correctly. They depend on an older version of openfisca-uk
.
The modifications to the OpenFisca-UK microsimulation model are described in the ubi_reform()
function in py/calc_ubi.py
.
The optimisation process and loss function are described in py/optimize.py
and py/loss_functions.py
.