Government Debt Dynamics
Get the government debt dynamics of a variety of countries: the interest-growth differential (r - g) and the primary balance that keeps the debt-to-GDP ratio stable, next to the primary balance the government ran.
The debt-to-GDP ratio d follows \(d (t) = d (t - 1)\) x (1 + r) / (1 + g) - pb(t), with r the effective interest rate on the debt, g the growth of nominal GDP and pb the primary balance (the budget balance before interest). When r is below g, as Blanchard (2019) documents for most of US history, debt shrinks relative to GDP without a primary surplus and a primary deficit can still keep the ratio stable; when r exceeds g, a primary surplus is needed. The Primary Balance Gap is the primary balance minus the one that stabilizes the debt: negative when the debt-to-GDP ratio rises.
The Effective Interest Rate is the interest of the year over the debt at the end of the year before, with Debt to GDP(t-1) the ratio of the year before. The formula is as follows:
\[\text{Effective Interest Rate} = \frac{\text{Interest to GDP} \cdot (1 + \text{Nominal GDP Growth})}{\text{Debt to GDP}_{t-1}}\] \[\text{Interest Growth Differential} = \text{Effective Interest Rate} - \text{Nominal GDP Growth}\] \[\text{Primary Balance} = \text{Budget Balance to GDP} + \text{Interest to GDP}\] \[\text{Debt Stabilizing Primary Balance} = \frac{\text{Interest Growth Differential}}{1 + \text{Nominal GDP Growth}} \cdot \text{Debt to GDP}_{t-1}\] \[\text{Primary Balance Gap} = \text{Primary Balance} - \text{Debt Stabilizing Primary Balance}\]The Interest Growth Differential and Debt Stabilizing Primary Balance are the columns Interest-Growth Differential and Debt-Stabilizing Primary Balance.
The interest is the general government’s interest expenditure of the IMF’s government finance statistics, as a share of GDP (around 40 economies, see get_government_interest_expenditure_to_gdp_ratio); the debt and budget balance to GDP and the nominal GDP come from the Global Macro Database. The interest is gross (before interest received), so the effective interest rate is that of the gross debt. Every value is a decimal (0.03 for 3%, or 3% of GDP), yearly, with a positive primary balance a surplus.
Also known as: r - g, r minus g, interest-growth differential, snowball effect, debt-stabilising primary balance, fiscal sustainability gap.
Example · United States, Italy · 2019 to 2024
Install the Finance Toolkit with pip install financetoolkit -U, then call get_government_debt_dynamics:
from financetoolkit import Economics
economics = Economics(start_date='2019-01-01', end_date='2024-12-31')
economics.get_government_debt_dynamics(countries=['United States', 'Italy'])['Italy'].T
Or, with the Finance Toolkit MCP set up, ask an AI assistant such as Claude or ChatGPT:
How did the interest rate on Italy's government debt compare with its nominal GDP growth from 2019 to 2024, and what primary balance would have kept its debt ratio stable?
Which returns:
| Item | 2019 | 2020 | 2021 | 2022 | 2023 | 2024 |
|---|---|---|---|---|---|---|
| Effective Interest Rate | 0.0252 | 0.0236 | 0.0244 | 0.0304 | 0.0283 | 0.0299 |
| Nominal GDP Growth | 0.0148 | -0.0743 | 0.1033 | 0.0844 | 0.0724 | 0.0277 |
| Interest-Growth Differential | 0.0104 | 0.0980 | -0.0789 | -0.0541 | -0.0441 | 0.0023 |
| Debt to GDP Ratio | 1.3390 | 1.5438 | 1.4582 | 1.3836 | 1.3394 | 1.3474 |
| Primary Balance | 0.0184 | -0.0598 | -0.0548 | -0.0402 | -0.0345 | 0.0050 |
| Debt-Stabilizing Primary Balance | 0.0138 | 0.1417 | -0.1103 | -0.0727 | -0.0569 | 0.0029 |
| Primary Balance Gap | 0.0046 | -0.2015 | 0.0555 | 0.0325 | 0.0224 | 0.0021 |
7 rows
Parameters
get_government_debt_dynamics accepts the following parameters.
| Parameter | Type | Description | Example |
|---|---|---|---|
countries | list[str] | str | None | The countries to include in the data. Defaults to None, which includes every country with interest expenditure and debt. | ["United States", "Germany"] |
level | str | The government the debt and budget balance cover. Options are: “consolidated” (the Global Macro Database’s combination of general and central government figures, with the longest history), “general” (general government: central, state and local government and social security, as the interest expenditure covers), “central” (central government only). Defaults to “general”. | "general" |
transform | str | list[str] | None | Time series steps applied in order, such as “sma:12” (moving average), “pct_change”, “yoy”, “zscore:60” or “hp_cycle” (Hodrick-Prescott), before growth and the date range, on the history before the start date. Defaults to None. | None |
growth | bool | Whether to return the growth data or the actual data. Defaults to False. | True |
lag | int | list[int] | The number of periods to lag the growth data by. Defaults to 1. | 4 |
rounding | int | None | The number of decimals to round the results to. Defaults to None, which uses the rounding of the Economics class. | 2 |
show_columns | str | list[str] | None | The columns to keep, a name or a list of names, matched on every column level, or the rows when no column has those names (such as the line items of a financial statement). Names that do not exist are logged, and when none exist the result is returned in full. Defaults to None, which keeps every column. | None, which keeps every column |
References
- Paper Blanchard, O. (2019). “Public Debt and Low Interest Rates.” American Economic Review, 109(4), 1197-1229.
- Paper International Monetary Fund (2013). “Staff Guidance Note for Public Debt Sustainability Analysis in Market-Access Countries.” IMF Policy Paper, 9 May 2013.
- Source Global Macro Database, Government debt and deficit to GDP, nominal GDP (govdebt_GDP, govdef_GDP, nGDP)
- Source International Monetary Fund, Government Finance Statistics, general government interest (QGFS, G24_T_XDC)
- Source International Monetary Fund, Annual National Economic Accounts, nominal GDP (ANEA, B1GQ)