Skip to content

Commit

Permalink
Merge pull request #51 from jdebacker/demog_core
Browse files Browse the repository at this point in the history
Use `demographics.py` from OG-Core
  • Loading branch information
jdebacker committed Mar 19, 2024
2 parents a34bb49 + 94eb53d commit 1c0832b
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 1,492 deletions.
29 changes: 29 additions & 0 deletions PSL_catalog.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name": "OG-ZAF",
"img": "https://github.com/EAPD-DRB/OG-ZAF/blob/main/docs/OG-ZAF_logo.png?raw=true",
"banner_title": "OG-ZAF",
"banner_subtitle": "An overlapping-generations macroeconomic model for evaluating fiscal policy in South Africa",
"detailed_description": "OG-ZAF is an overlapping-generations (OG) model that allows for dynamic general equilibrium analysis of fiscal policy for South Africa. OG-ZAF is built on the OG-Core framework. The model output includes changes in macroeconomic aggregates (GDP, investment, consumption), wages, interest rates, and the stream of tax revenues over time. Regularly updated documentation of the model theory--its output, and solution method--and the Python API is available at https://pslmodels.github.io/OG-Core and documentation of the specific South African calibration of the model will be available soon.",
"policy_area": "Fiscal policy, Macroeconomics, Demographics",
"geography": "South Africa",
"language": "Python",
"maintainers": [
{
"name": "Richard W. Evans",
"image": "https://github.com/rickecon.png",
"link": "https://github.com/rickecon"
},
{
"name": "Marcel LaFleur",
"image": "https://avatars.githubusercontent.com/u/231228?v=4",
"link": "https://github.com/SeaCelo"
},
],
"links": {
"code_repository": "https://github.com/EAPD-DRB/OG-ZAF",
"user_documentation": "https://eapd-drb.github.io/OG-ZAF/content/intro/intro.html",
"contributor_documentation": "https://eapd-drb.github.io/OG-ZAF/content/contributing/contributor_guide.html",
"webapp": "",
"recent_changes": "https://github.com/EAPD-DRB/OG-ZAF/blob/main/CHANGELOG.md"
}
}
26 changes: 20 additions & 6 deletions ogzaf/calibrate.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
from ogzaf import demographics
from ogzaf import macro_params
from ogzaf import income
from ogzaf import macro_params, income
from ogzaf import input_output as io
import os
import numpy as np
from ogcore import txfunc
from ogcore import txfunc, demographics
from ogcore.utils import safe_read_pickle, mkdirs
import pkg_resources

Expand Down Expand Up @@ -71,10 +69,26 @@ def __init__(

# demographics
self.demographic_params = demographics.get_pop_objs(
p.E, p.S, p.T, p.start_year
p.E,
p.S,
p.T,
0,
99,
country_id="710", # UN code for ZAF
initial_data_year=p.start_year - 1,
final_data_year=p.start_year,
)
# demographics for 80 period lives (needed for getting e below)
demog80 = demographics.get_pop_objs(20, 80, p.T, p.start_year)
demog80 = demographics.get_pop_objs(
20,
80,
p.T,
0,
99,
country_id="710", # UN code for ZAF
initial_data_year=p.start_year - 1,
final_data_year=p.start_year,
)

# earnings profiles
self.e = income.get_e_interp(
Expand Down
Loading

0 comments on commit 1c0832b

Please sign in to comment.