Open economies

NOTE: The present notebook is coded in R. It relies heavily on the tidyverse ecosystem of packages. We load the tidyverse below as a prerequisite for the rest of the notebook - along with a few other libraries.

\(\rightarrow\) Don’t forget that code flows sequentially. A random chunk may not work if the previous have have not been executed.

The content of the notebook is heavily inspired from the book Advanced Macro-economics - An Easy Guide.

library(tidyverse)   # Package for data wrangling
library(readxl)      # Package to import MS Excel files
library(latex2exp)   # Package for LaTeX expressions
library(quantmod)    # Package for stock data extraction
library(highcharter) # Package for reactive plots

Context

Until now, we have studied closed economies, i.e., in which there are no interactions with other economic systems. These interactions can be of various types, including trade, corporate investment, savings, etc.

We start with a few notions of macroeconomic accounting.

  • GDP: Gross Domestic Product: amount of goods produced in a given country.
  • GNI: Gross National Income (or Product): amount of money paid to a country’s residents.

\[GNI = GDP + rB,\] where \(B\) is the position of assets held by residents in foreign assets minus the local assets held by foreigners; \(r\) is the rate paid on these assets. \(rB\) is the net payment of foreigners made to residents (it can be negative!).

Now, we can decompose GDP using the (expenditure approach) \[GDP=C+I+G+X-M.\] Where \(C\) is consumption (private expenditures), \(I\) investment (from corporations and individuals, e.g., in housing), \(G\) government expenditures, \(X\) exports and \(M\) imports. The last term is very important, as \(G\), \(I\) and \(C\) include importations, hence we must not count them as domestic.

The Ramsey with debt/bond

Formulation

For simplicity, we fix \(n=0\) and \(L_0=1\) so that population remains contants and all terms cann be viewed as per capita. As in the Ramsey model, the utility is \[U=\int_0^\infty e^{-\rho t} u(c_t)dt.\] We also have \(\dot{k}_t=f(k_t)-c_t\) (simplified dynamic for capital), and the representative inhabitant/agent has access to a bond which pays a payoff rate of \(r\): \(\dot{b}_t=rb_t\), with \(b_t\) being the value of the bond (or amount detained in the economy).

The total assets (per capita) in the economy are \(a_t=k_t+b_t\), hence \[\dot{a}=f(k_t)+rb_t-c_t= f(k_t)+r(a_t-k_t)-c_t \tag{1}\]

The Hamiltonian in the optimization of consumption with the above constraint is \[H = u(c_t)+\lambda_t (f(k_t)+r(a_t-k_t)-c_t)\] The first order conditions are then \[u'(c_t)=\lambda_t \quad (\text{derivative w.r.t. } c_t) \tag{2}\] \[f'(k_t)=r \quad (\text{derivative w.r.t. } k_t)\] \[ \frac{\partial H}{\partial a}+ \dot{\lambda}_t = \rho \lambda_t \quad \Leftrightarrow \quad \dot{\lambda}_t=(\rho-r) \lambda_t \quad (\text{co-state variable)}\] Imagine \(\lambda_t\) is an asset, then the l.h.s. is the marginal income of investing in this asset (from dividend/utility plus capital gains). The r.h.s. is the rate at which is makes exactly sense to hold the asset: it must precisely compensate for the discount rate \(\rho\).

Differentiating the last equation w.r.t. time and plugging Equation 2, we get \[\dot{c}_tu''(c_t)=(\rho-r)u'(c_t),\]

so that \[\frac{\dot{c}_t}{c_t}=\sigma (r-\rho) \quad (\text{recall} \quad \sigma = -\frac{u'(c_t)}{c_tu''(c_t)}). \tag{3}\]

This is magic! It does not depend on \(k_t\), basically, it is constant! There are not dynamics…

The balanced growth path thus imposes \(r=\rho\). Then, all quantities in the model are constant. In particular, the equilibrium capital satisfies \(f'(k^*)=r\) (from the second FOC above) and total output is \(y=f(k^*).\)

Furthermore, note that, integrating Equation 1, we get \[a_te^{-rt}-a_0 = \frac{1-e^{-rt}}{r}(f'(k^*)-rk^*-c^*),\]

so that, as \(t\rightarrow \infty\) and under non-explosive assumptions, we get \[c^* = ra_0+f'(k^*)-rk^*.\]

Some comments on the model

The most salient property of the model in Equation 3. At the optimum (equilibrium), any deviation from \(k^*\) or \(c^*\) is immediately corrected. The trick is that the residents of the home country are able to adjust by purchasing any amount of required capital - thanks to the bond. This does not affect the national assets, because \(a=k+b\), hence reducing \(b\) by the same amount that \(k\) increases leaves \(a\) unchanged.

Sustainability of public debt

We leave growth aside for now to focus on the law of motion of public debt (from François Geerolf’s lecture notes). We write:

  • \(G_t\) for government spending (at time \(t\))
  • \(T_t\) the taxes collected at time \(t\)
  • \(r_t\) the interest rate paid at time \(t\) (unique for simplicity)

The debt then follows the following process

\[D_t = G_t-T_t+(1+r_t)D_{t-1},\] where the state has to reimburse interest rates on the previous debt \(D_{t-1}\).

The deficit follows

\[\Delta D_t = D_t-D_{t-1}=\underbrace{G_t-T_t}_{\text{primary deficit}}+\underbrace{r_tD_{t-1}}_{\text{interest payment}}.\]

If we divide by GDP \(Y_t\), \[\frac{D_t}{Y_t}=(1+r_t)\frac{Y_{t-1}}{Y_{t}}\frac{D_{t-1}}{Y_{t-1}}+\frac{G_t-T_t}{Y_t},\]

and if \(d_t=D_t/Y_t\), \[d_t = \frac{1+r_t}{1+g_Y}d_{t-1}+\frac{G_t-T_t}{Y_t}, \tag{4}\]

where \(g_Y\) is the deterministic growth rate of the economy.

Let’s make some simplifications and assume a constant rate \(r_t=r\). Moreover, we suppose that \(\mathbb{E}\left[\frac{G_t-T_t}{Y_t}\right]=\epsilon\). Then \(d_t\) follows a first order autoregressive model (AR(1)). It is well-behaved only if \(r<g_Y\), i.e., if GDP growth is able to finance the debt. If not, the debt explodes. If \(r=g_Y\), then the debt/DGP ratio is a random walk. If the right term of Equation 4 is zero and not random, then the ratio is constant.

A look at the data

Let’s see how that translates into actual rates.

We first fetch the data.

library(tidyverse)
library(WDI)
wb_raw = WDI(indicator = c("inflation" = "FP.CPI.TOTL.ZG",
                           "debt" = "GC.DOD.TOTL.GD.ZS",
                           "lend" = "FR.INR.LEND",          # lending rate
                           "risk_premium" = "FR.INR.RISK",  # = lending - treasury
                           "real_interest" = "FR.INR.RINR"), 
              #country = c('FR','US'), # here you can specify some countries
              extra = TRUE,
              start = 1960, 
              end = 2023) |>
  mutate(across(everything(), as.vector)) |>
  select(-status, -lending, -iso2c, -iso3c) 

Then compute the desired quantities and plot them.

wb_raw |>
  na.omit() |>
  filter(country %in% c("Italy", "United States", "Brazil"),
         year > 2001) |>
  arrange(country, year) |>
  group_by(country) |>
  mutate(interest_rate = lend - risk_premium,
         debt_growth = 100*(debt / lag(debt) - 1)) |>
  select(country, year, interest_rate, debt_growth) |>
  pivot_longer(-c(country, year), values_to = "value", names_to = "rate") |>
  ggplot(aes(x = year, y = value, color = country, linetype = rate)) + geom_line() +
  theme_classic() +
  theme(axis.title = element_blank())

If we consider a variety of countries…

wb_raw |>
  na.omit() |>
  arrange(country, year) |>
  group_by(country) |>
  mutate(interest_rate = lend - risk_premium,
         n = n(),                               # Counting countries
         debt_growth = 100*(debt / lag(debt) - 1)) |>
  filter(n > 20) |>                             # We want at least 20 obs.
  summarise(r = mean(interest_rate, na.rm = T),
            g = mean(debt_growth, na.rm = T),
            g_r = g-r) |>
  arrange(g_r)
country r g g_r
Jamaica 17.2376061 0.5994413 -16.6381648
Romania 15.9433658 3.3013658 -12.6420000
Moldova 9.9823016 -0.5347432 -10.5170448
Hungary 8.3453107 -0.2311231 -8.5764338
Philippines 8.7470150 0.3541315 -8.3928835
Malaysia 3.7976157 -1.7143889 -5.5120046
Canada 3.5281250 -0.4749898 -4.0031148
Iceland 7.5134109 4.3886384 -3.1247725
Italy 2.5123539 0.9604992 -1.5518547
Singapore 1.4629340 1.4565628 -0.0063712
United States 2.7324411 4.1189624 1.3865213
Bahamas, The 2.5115932 5.4949241 2.9833309
United Kingdom 4.7446677 8.6119991 3.8673315
Japan 0.3084533 6.7483300 6.4398766
Bahrain 3.4323036 10.8333865 7.4010829

Lots of different situations…