Skip to content

Add government debt contracted abroad at its own interest rate - #1279

Open
marcelolafleur wants to merge 5 commits into
PSLmodels:masterfrom
marcelolafleur:concessional-debt
Open

marcelolafleur wants to merge 5 commits into
PSLmodels:masterfrom
marcelolafleur:concessional-debt

Conversation

@marcelolafleur

Copy link
Copy Markdown
Contributor

This PR addresses Issue #1125 by adding government debt contracted abroad, such as concessional loans from official lenders or bonds issued abroad, held only by foreigners and paying its own interest rate rather than the household portfolio return.

Adds

  • Adds the time-varying parameters alpha_D_ext (the stock as a share of GDP) and r_D_ext_annual (its real interest rate), both default 0. The debt enters the government budget, the closure rule and the resource constraint; it is not part of households' portfolio, so debt_ratio_ss and zeta_D keep referring to market debt.
  • Adds fiscal.get_D_ext and the outputs D_ext, new_borrowing_ext and debt_service_ext.
  • Adds tests, including a steady state and a transition (marked local) with external debt that keep the budget and the goods market in balance every period.

Updates

  • The debt-elastic premium on r_gov is evaluated at all government debt, market plus external. Total debt is also reported in the macro table and calibration moments. Both are unchanged when alpha_D_ext is 0.

Example: OG-ETH, first year (FY2024/25), percent of GDP

Same calibration, with Ethiopia's external debt (15.5 percent of GDP, mostly concessional) held as market debt abroad (off) or as debt contracted abroad at its own rate (on):

Off On Data
Interest on public debt held abroad 1.6 −0.2 about 0
Payments abroad on capital and debt 4.0 2.5 0.4
Trade balance −0.6 −3.2 −4.5
Investment 32.8 35.3 35.3
Total public debt 27.2 27.2 27.2

cc: @jdebacker @rickecon

…and flows, the budget in every period, and the resource constraint along the path
…_annual), price the debt premium on all government debt, report total debt, and document the new outputs
@codecov-commenter

codecov-commenter commented Nov 13, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 88.23529% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.70%. Comparing base (f95bf15) to head (ad22ad9).

Files with missing lines Patch % Lines
ogcore/output_plots.py 0.00% 3 Missing ⚠️
ogcore/output_tables.py 50.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1279      +/-   ##
==========================================
+ Coverage   79.68%   79.70%   +0.02%     
==========================================
  Files          24       24              
  Lines        6762     6785      +23     
==========================================
+ Hits         5388     5408      +20     
- Misses       1374     1377       +3     
Flag Coverage Δ
unittests 79.70% <88.23%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
ogcore/SS.py 91.85% <100.00%> (+0.03%) ⬆️
ogcore/TPI.py 82.16% <100.00%> (+0.02%) ⬆️
ogcore/__init__.py 100.00% <100.00%> (ø)
ogcore/fiscal.py 100.00% <100.00%> (ø)
ogcore/parameters.py 89.84% <100.00%> (+0.03%) ⬆️
ogcore/utils.py 85.57% <ø> (ø)
ogcore/output_tables.py 89.05% <50.00%> (ø)
ogcore/output_plots.py 87.90% <0.00%> (-0.58%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

marcelolafleur added a commit to marcelolafleur/OG-PHL that referenced this pull request Nov 13, 2026
Recalibrates the single-industry model to Philippine data and checks it
against the government's fiscal program.

- Model ratios are compared with GDP at market prices, the basis the data
  use; shares OG-Core applies to its own output are converted to match.
- Capital, saving, hours, earnings and starting wealth match Philippine
  data: measured depreciation, the ILO capital share, saving and foreign
  capital tuned to 2025, hours from the Labor Force Survey, the NTA age
  shape of earnings and of initial wealth, the 2023 income Gini, and
  income gradients in fertility and mortality.
- Taxes match collections by instrument. Pensions follow the SSS
  defined-benefit rules and phase in from today's spending. Spending
  follows the 2025-2028 fiscal program, then holds debt near 60% of GDP.
- The government's external debt (19.4% of GDP) is modelled as debt
  contracted abroad at its own rate (2.44% real), not as market debt
  paid the household return. Market debt is the domestic debt, 4.2% held
  by non-residents, and the government rate is anchored to the domestic
  rate (2.33% real).
- The example makes no live data calls, and the steady state starts from
  a shipped solved state. Adds a steady-state tuning script and a sourced
  dashboard of targets.
- uv installs OG-Core from master plus PSLmodels/OG-Core#1279, #1280,
  #1276 and #1277 until they are released; a full run takes about 9
  minutes.

@arihantlodha-cmd arihantlodha-cmd left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a really useful addition, and the OG-ETH table makes the case well. I checked get_D_ext against the market-debt flows in D_G_path, and the g_n[: p.T] indexing matches. One question about the steady state. With the stock pinned at alpha_D_ext * Y, the government gets (g_n + g_y) * D_ext in new borrowing each period and pays r_ext * D_ext. When r_D_ext is below the growth rate, which is the concessional case, that's a permanent net inflow from abroad in the long run. That's probably right for official lending that gets rolled over, but would it be worth a note in the parameter description, or a warning when r_D_ext[-1] is below growth? Otherwise users might not realize that their long-run budget is partly financed by it. Separately, this PR and #1280 both bump the version (0.25.0 vs 0.24.5), so the CHANGELOG will need reconciling depending on which merges first.

# Conflicts:
#	CHANGELOG.md
#	ogcore/__init__.py
#	pyproject.toml
#	tests/test_TPI.py
#	uv.lock

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants