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:

Parameters

get_government_debt_dynamics accepts the following parameters.

ParameterTypeDescriptionExample
countrieslist[str] | str | NoneThe countries to include in the data. Defaults to None, which includes every country with interest expenditure and debt.["United States", "Germany"]
levelstrThe 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"
transformstr | list[str] | NoneTime 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
growthboolWhether to return the growth data or the actual data. Defaults to False.True
lagint | list[int]The number of periods to lag the growth data by. Defaults to 1.4
roundingint | NoneThe number of decimals to round the results to. Defaults to None, which uses the rounding of the Economics class.2
show_columnsstr | list[str] | NoneThe 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

Share