Public debt dynamics
The path of debt to GDP from an initial ratio and paths of the effective interest rate, nominal growth and the primary balance, with r - g and the debt-stabilizing primary balance.
- Model id
macro.debt_dynamics, version 1- Domain
- Macroeconomics
- Evidence
- standard
- Cost class
- instant: A closed-form calculation; a hosted run may take up to 2 seconds.
Formula
Where
- Public debt over GDP at the end of year t
debt_ratio_path - The same ratio a year earlier; the first is the starting ratio
initial_ratio - Nominal interest rate on the debt in year t
interest_rate - Nominal GDP growth in year t
nominal_growth - Primary balance over GDP in year t; a surplus is positive
primary_balance - The primary balance that keeps the ratio where it is
stabilizing_balance - The interest-growth differential
interest_growth_differential
Each symbol's field is named beside it; the inputs and outputs, with their units and bounds, are under Variables, and the citations give each formula's source.
Variables
Rates, returns and yields are decimals: 0.05 is five percent. Bounds in brackets include their end; in parentheses they exclude it.
Inputs
| Name | Unit | Bounds | Description |
|---|---|---|---|
Initial ratioinitial_ratioratio · [0, 10] | ratio | [0, 10] | Debt over GDP at the start, d0 (1.0 is 100% of GDP) |
Interest rateinterest_raterate (array) · length min 1, max 100; each [-0.1, 0.5] | rate (array) | length min 1, max 100; each [-0.1, 0.5] | The effective nominal interest rate each period: interest paid over the debt at the end of the period before |
Nominal growthnominal_growthrate (array) · length min 1, max 100; each [-0.5, 0.5] | rate (array) | length min 1, max 100; each [-0.5, 0.5] | Nominal GDP growth each period |
Primary balanceprimary_balanceratio (array) · length min 1, max 100; each [-0.5, 0.5] | ratio (array) | length min 1, max 100; each [-0.5, 0.5] | The primary balance over GDP each period: revenue less non-interest spending, a deficit negative |
Outputs
| Name | Unit | Bounds | Description |
|---|---|---|---|
Debt ratio pathdebt_ratio_pathratio (array) · length max 100; each [-1e+06, 1e+06] | ratio (array) | length max 100; each [-1e+06, 1e+06] | Debt over GDP at the end of each period |
Final ratiofinal_ratioratio · [-1e+06, 1e+06] | ratio | [-1e+06, 1e+06] | Debt over GDP at the end |
Change in ratiochange_in_ratioratio · [-2e+06, 2e+06] | ratio | [-2e+06, 2e+06] | The final ratio less the initial one |
Interest growth differentialinterest_growth_differentialrate (array) · length max 100; each [-1, 1] | rate (array) | length max 100; each [-1, 1] | r - g each period: the interest rate less nominal growth |
Stabilizing balancestabilizing_balanceratio (array) · length max 100; each [-2e+06, 2e+06] | ratio (array) | length max 100; each [-2e+06, 2e+06] | The primary balance over GDP that would hold each period's ratio at the ratio before it |
Calculator
Run the model on your own inputs, starting from its example. Rates are decimals: 0.05 is five percent. The run goes to the pyeconomics API on this site: your values travel only in the request, and nothing is stored.
Loading the calculator…
Worked example
A ratio near 100% of GDP, with r - g below zero.
Example five_year_projection. Inputs:
{
"initial_ratio": 1,
"interest_rate": [0.033, 0.034, 0.035, 0.036, 0.036],
"nominal_growth": [0.045, 0.042, 0.04, 0.039, 0.039],
"primary_balance": [-0.03, -0.028, -0.027, -0.027, -0.026]
}Outputs:
{
"change_in_ratio": 0.10750885599250704,
"debt_ratio_path": [
1.0185167464114833,
1.0386970401050613,
1.0607033043353251,
1.0846406383940297,
1.107508855992507
],
"final_ratio": 1.107508855992507,
"interest_growth_differential": [
-0.011999999999999997, -0.008,
-0.0049999999999999975,
-0.0030000000000000027,
-0.0030000000000000027
],
"stabilizing_balance": [
-0.011483253588516745,
-0.007819706306422137,
-0.004993735769735868,
-0.0030626659412954556,
-0.0031317824015227066
]
}Assumptions
- The identity holds when debt changes only by interest and the primary balance; anything else that moves debt (other means of financing, valuation changes) is outside it.
- Rates and growth are per period, and the primary balance is a share of that period's GDP; the stabilizing balance holds the ratio at the one the path reached the period before.
- Profile: default binds US federal debt over GDP, the Treasury's average interest rate on its debt, nominal GDP growth over four quarters and the federal primary balance over GDP: a one-year path from the latest data.
Limitations
- A projection is only as good as its paths: the model assumes them and does not forecast rates, growth or policy.
- The default profile's debt is total public debt (including debt the government holds) and its interest rate the Treasury's average on interest-bearing debt, not CBO's debt held by the public.
- A path that compounds past a million times GDP raises DomainError.
Evidence
Status: standard. Textbook consensus, such as bond duration or the CAPM formula.
Every model declares one status: standard (textbook consensus), practitioner (a widely used convention), contested (under active debate), rejected (failed out of sample) or historical (a superseded methodology).
Syllabus
The 2027 CFA® Program's topic areas this model relates to, as factual tags. Each links to CFA Institute's page for its level; pyeconomics holds none of the curriculum's text.
Data
This model can read its data for you: each bound field names a data series, and the sources listed can fill it, in the order they are tried. This website reads only the sources whose terms let it serve their data (marked "hosted"); every source is available when you run pyeconomics on your own computer.
| Field | Concept | Read as | Sources (licence class; hosted) |
|---|---|---|---|
initial_ratio | Federal debt to GDPus.fiscal.debt_to_gdp | last observation on or before the date; real time: as published by the date |
|
interest_rate | Average interest rate on federal debtus.fiscal.average_interest_rate | the last 1 observations on or before the date; real time: as published by the date |
|
nominal_growth | Nominal GDP growth, year over yearus.output.nominal_gdp.yoy | the last 1 observations on or before the date; real time: as published by the date |
|
primary_balance | Federal primary balance to GDPus.fiscal.primary_balance_to_gdp | the last 1 observations on or before the date; real time: as published by the date |
|
Citations
- Escolano, J. (2010). A Practical Guide to Public Debt Dynamics, Fiscal Sustainability, and Cyclical Adjustment of Budgetary Aggregates. International Monetary Fund, Technical Notes and Manuals 10/02. doi:10.5089/9781462396955.005 (Section II: the debt-ratio equation and the debt-stabilizing balance)
- Blanchard, O. (2019). Public Debt and Low Interest Rates. American Economic Review, 109(4), 1197-1229. doi:10.1257/aer.109.4.1197 (Section I: the debt dynamics when the safe rate is below growth)
- Congressional Budget Office. The Long-Term Budget Outlook, and its supplemental long-term budget projections. https://www.cbo.gov/topics/budget/long-term-budget-projections (Debt held by the public, net interest, primary deficits and GDP)
Changelog
- Version 1: First version.
Use it elsewhere
- Documentation
- The model's reference page
- REST API
GET or POST /v1/models/macro.debt_dynamics/run- MCP tool
run_modelwith the model's id,macro.debt_dynamics. Connect an assistant- Command line
pyeconomics models run macro.debt_dynamics --help
The worked example, from Python and from the command line:
import pyeconomics
inputs = {
"initial_ratio": 1,
"interest_rate": [0.033, 0.034, 0.035, 0.036, 0.036],
"nominal_growth": [0.045, 0.042, 0.04, 0.039, 0.039],
"primary_balance": [-0.03, -0.028, -0.027, -0.027, -0.026],
}
result = pyeconomics.run("macro.debt_dynamics", inputs)
print(result.to_json())
pyeconomics models run macro.debt_dynamics --inputs - <<'JSON'
{
"initial_ratio": 1,
"interest_rate": [0.033, 0.034, 0.035, 0.036, 0.036],
"nominal_growth": [0.045, 0.042, 0.04, 0.039, 0.039],
"primary_balance": [-0.03, -0.028, -0.027, -0.027, -0.026]
}
JSON