Macro Parameter Estimation Functions

Macro Parameter Estimation Functions#

macro_params.py modules

ogzaf.macro_params#

This module uses data from World Bank WDI, World Bank Quarterly Public Sector Debt (QPSD) database, the IMF, and UN ILO to find values for parameters for the OG-ZAF model that rely on macro data for calibration.

ogzaf.macro_params._fetch_wb_data(indicators, country_iso, start_year, end_year, source)[source]#

Fetch a set of World Bank indicators and return a single DataFrame.

Parameters:
  • indicators (dict) – mapping of human-readable labels to indicator codes

  • country_iso (str) – ISO country code

  • start_year (int) – first year to request

  • end_year (int) – last year to request

  • source (int) – World Bank source ID

Returns:

DataFrame indexed by year/quarter label

Return type:

pandas.DataFrame

ogzaf.macro_params._get_imf_macro_params(country_iso, target_year, data_path=None)[source]#

Fetch IMF GFS data and compute alpha_T and alpha_G.

Parameters:
  • country_iso (str) – ISO alpha-3 country code

  • target_year (int) – preferred calibration year

  • data_path (str | Path | None) – optional path to save IMF CSV data

Returns:

IMF-derived macro parameters

Return type:

dict

ogzaf.macro_params.get_macro_params(data_start_date=datetime.datetime(1947, 1, 1, 0, 0), data_end_date=datetime.datetime(2024, 12, 31, 0, 0), country_iso='ZAF', update_from_api=False, imf_data_year=None, imf_data_path=None)[source]#

Compute values of parameters that are derived from macro data

Parameters:
  • data_start_date (datetime) – start date for data

  • data_end_date (datetime) – end date for data

  • country_iso (str) – ISO code for country

  • imf_data_year (int | None) – IMF target year override. Defaults to data_end_date.year when None.

  • imf_data_path (str | Path | None) – optional path to save IMF CSV data

Returns:

dictionary of parameter values

Return type:

macro_parameters (dict)