PSLmodels / OG-Core

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

demographics.py missing an important functionality #899

Closed jdebacker closed 9 months ago

jdebacker commented 9 months ago

We need to allow for demographics.py to be able to return path of population distributions when given (1) an initial distribution (2) paths of fertility, mortality, and immigration rates.

This could probably be best implemented in the demographics.get_pop() function with something like:

def get_pop(
    E=20,
    S=80,
    min_age=0,
    max_age=99,
    infer_pop=False
    fert_rates=None,
    mort_rates=None,
    infmort_rates=None,
    imm_rates=None,
    pre_pop_dist=None,
    country_id=UN_COUNTRY_CODE,
    start_year=START_YEAR,
    end_year=END_YEAR,
):
   if not infer_path:
       do current functionality

   else:
       find implied pop path from fert, mort, imm rates + either(pre_pop or UN data if pre pop not given)
    return pop_2D, pre_pop
rickecon commented 9 months ago

This is implemented by PR #902. Closing.