PSLmodels / OG-Core

An overlapping generations model framework for evaluating fiscal policies.
https://pslmodels.github.io/OG-Core/
Creative Commons Zero v1.0 Universal
65 stars 111 forks source link

Add functions for shifting age related parameters, computing pct changes in output #915

Closed jdebacker closed 5 months ago

jdebacker commented 5 months ago

This PR adds two new utilities to the utils.py modules:

  1. shift_bio_clock: this function can shift age-related parameters that also vary over time (e.g., mortality rates) by a certain number of years, with a transition over time
  2. pct_change_unstationarized: this function computes percentage changes in unstationarized output (useful if the baseline and reform runs feature different rates of economic growth or population growth).
codecov-commenter commented 5 months ago

Codecov Report

Attention: Patch coverage is 78.94737% with 12 lines in your changes are missing coverage. Please review.

Project coverage is 73.17%. Comparing base (3d638e8) to head (637e0c8). Report is 5 commits behind head on master.

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/PSLmodels/OG-Core/pull/915/graphs/tree.svg?width=650&height=150&src=pr&token=98mQCVhspd&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=PSLmodels)](https://app.codecov.io/gh/PSLmodels/OG-Core/pull/915?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=PSLmodels) ```diff @@ Coverage Diff @@ ## master #915 +/- ## ========================================== - Coverage 79.84% 73.17% -6.68% ========================================== Files 19 19 Lines 4506 4563 +57 ========================================== - Hits 3598 3339 -259 - Misses 908 1224 +316 ``` | [Flag](https://app.codecov.io/gh/PSLmodels/OG-Core/pull/915/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=PSLmodels) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/PSLmodels/OG-Core/pull/915/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=PSLmodels) | `73.17% <78.94%> (-6.68%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=PSLmodels#carryforward-flags-in-the-pull-request-comment) to find out more. | [Files](https://app.codecov.io/gh/PSLmodels/OG-Core/pull/915?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=PSLmodels) | Coverage Δ | | |---|---|---| | [ogcore/utils.py](https://app.codecov.io/gh/PSLmodels/OG-Core/pull/915?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=PSLmodels#diff-b2djb3JlL3V0aWxzLnB5) | `88.47% <78.94%> (-1.45%)` | :arrow_down: | ... and [5 files with indirect coverage changes](https://app.codecov.io/gh/PSLmodels/OG-Core/pull/915/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=PSLmodels)