OG-Core icon indicating copy to clipboard operation
OG-Core copied to clipboard

Fix `num_years_to_plot` in `output_plots.plot_all`

Open jdebacker opened this issue 3 years ago • 3 comments

Several of the plots in output_plots.plot_all assume that the time path is at least 150 periods (see here). This causes issues if a user sets T to a value less than 150.

A solution to this would be to replace num_years_to_plot=150 to num_years_to_plot=min(base_params.T, 150).

jdebacker avatar Oct 30 '21 21:10 jdebacker

@jdebacker I have made the following changes to run_og_core_example.py to allow us to supply a different set of parameters to the example. I also included an option to send an email when the code has finished running.

image

image

image

This required changes in output_plots.py

image

The ability_bar also needed to be changed as it was accessing constants.py to access the GROUP_LABELS for the bar plot which was hard coded. I created a function to generate the labels from the lambdas.

image

sebastiansajie avatar Nov 03 '21 20:11 sebastiansajie

@sebastiansajie I like your fixes to the output_plots.py.plot_all() function and the lambda_labels (really creative solution there!). Thank you for proposing these.

I'd recommend adding the lambda_labels() function to utils.py as it it can then be imported and used in output_plots.py and parameter_plots.py (both of which currently import the GROUP_LABELS from constants.py and therefore have issues without J in [7, 9, 10].

I think the changes your propose to the example script are best left out of OG-Core for now. I like having the example script produce output with a more realistic calibration, even if it does take more time to run. You can just keep your modified script around for your own use (I have a bunch of these for different simulations I've run).

Let me know if you'd like to open a PR (here or at Revenue-Academy/OG-Core) or if you prefer, I can do it.

jdebacker avatar Nov 03 '21 23:11 jdebacker

@jdebacker, I can open a PR for 1) updates to output_plots.py and 2) Making changes to utils.py (adding lambda_labels()) in OG-Core and then eventually syncing it to Revenue Academy.

sebastiansajie avatar Nov 04 '21 01:11 sebastiansajie

Addressed in PR #923.

jdebacker avatar May 06 '24 01:05 jdebacker