Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use demographics.py from OG-Core #51

Merged
merged 5 commits into from
Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading