This post describes a complete, if very simple, economic model. We'll use the insights and mathematical formulations developed previously (e.g. here, here, and here) but these will be anchored within a wider accounting and modelling framework which helps us to organise our model components and ensure that the model is coherent.

## An accountancy framework¶

In order to impart some rigour on to our model we will use an analytical tool called a Godley Table (after the late economist Wynne Godley). This approach enables us to structure our model according to the transactions that occur between different sectors within our economy. The reason for splitting up the economy into sectors is that entities such as governments, business, banks, households, etc. have distinct types of relationships with the wider economy. We need to be able to resolve these idiosyncrasies if we're going to be able to understand how they interact to steer the economy on a given trajectory. Ultimately, we'd do well to resolve every single, individual business, household, person, etc. but that would be a more or less impossible task. So aggregating within each sector is a useful and pragmatic level of granularity.

Accounting for transactions that flow between sectors helps us to ensure that the model is coherent, complete and water-tight - all economic activity is accounted for and nothing is introduced or lost erroneously. This is achieved by making sure that stocks and flows of money are properly connected to each other: if money flows into a sector it must either flow out again or accumulate as a stock within that sector. This concept is called stock-flow consistency and is loosely analogous to the concepts of conservation and continuity in physics. The Godley Table approach helps us to figure all this out.

In previous posts (here, here) we've looked in some detail at they way in which government money is introduced into the economy and interacts with the circular flow of money in a concept known as the fiscal multiplier. This is the central concept that we'll build upon here, and so our model is going to need at least two sectors: the government and everyone else (the 'non-government' or 'private' sector). However, recall that a lot of economic activity does not involve the government. Specifically, consumption spending involves folk in the private sector purchasing goods and services from each other. This is inconvenient from an accounting perspective as these transactions cancel out within the sector giving the appearance of no economic activity at all (the spending and the income on each transaction are equal and opposite). In order to allow us to resolve these consumption transactions clearly we will split the private sector into households and businesses. This distinction will seem a bit contrived for now, but in more complicated models with additional sectors and forms of transactions, it will be more obviously useful and necessary.

So we'll define 3 sectors: government, business and households. Consider the table below.

households business government balance
flows
Government spending G -G 0
Payment of taxes -T T 0
Income (wages) Y -Y 0
Consumption spending -C C 0
stocks
Change in money $-\Delta H_h$ $\Delta H_g$ 0
balance 0 0 0 0

Okay, we've collected all of the flows between sectors into the upper part of the table. Each row represents a distinct type of transaction that we want to include in our model. And each transaction has two entries, a negative entry denoting the spending sector and a positive entry for the recipient sector. Since these values are equal and opposite, the sum of each row equals zero, as indicated by the final column.

We assume that government spending ($G$) is paid to the business sector (in exchange for goods or services presumbly). The business sector pays out wages to households (there are no profits as such). Households use this income to pay tax ($T$) to the government and to purchase goods and services from the business sector (consumption spending, $C$) which translates into more wages paid out to households. Each of these transactions are correctly balanced across the rows, summing to zero.

The columns represent the accounts - a description of the inflows and outflows - of each sector. Now, the inflows and outflows of an individual sector need not necessarily be equal. In such a case the sector must be either increasing or decreasing its financial wealth. This is accounted for in the stocks section of the table which describes the changes in monetary stocks for each sector ($\Delta H_h, \Delta H_g$). Once we include these stock changes we find that each column sums to zero. The inflows and the outflows are balanced the change in wealth. Organising the cross-sector transactions in such a way and checking that all rows and columns sum to zero helps to ensure that the model is stock-flow consistent.

Let's take a look at some of the sector accounts. For the business sector, summing across rows we get:

$G - Y + C = 0$

or rearranging:

$Y = G + C$

This is a familar equation that defines aggregate income ($Y$) in terms of the sources of that income, government spending ($G$) and consumption spending ($C$).

The household account looks like:

$-T + Y - C -\Delta H_h = 0$

or

$Y = T + C + \Delta H_h$

Again, this is familiar as a description of aggregate income ($Y$) in terms of the uses of that income, consumption spending ($C$), paying taxes ($T$) and saving ($H_h$). The latter term represents the change ($\Delta$) in money ($H$) held out of circulation by households ($_h$) and is more typically denoted ($S$) in these types of macroeconomic equations (e.g. $Y = C + T + S$).

We can also rearrange the latter equation as:

$Y - T - C = \Delta H_h$

which makes it explicit that saving is equal to aggregate income minus consumption spending and taxation. In other words, saving is simply the income left over after spending and paying taxes.

The government's account is:

$-G + T + \Delta H_g = 0$

or:

$T - G = -\Delta H_g$

$H_g$ is money held by the government. If spending ($G$) is greater than taxation ($T$) then the change in the government money stock is negative, representing a government budget deficit.

Recall that when we undertook a rather mechanical analysis of government money in circulation we discovered that a government budget deficit was equal to private saving. The same conclusion is explicit from the accounting framework described above given that we understand that each row must sum to zero, and that this includes the money stock row. However, we can also arrive at this conclusion by the following. Equating our two expressions for $Y$, above:

$G + C = T + C + \Delta H_h$

cancelling $C$ from both sides:

$G = T + \Delta H_h$

and rearranging:

$G - T = -\Delta H_g = \Delta H_h$

That is, private sector saving is equal to the government's budget deficit. All we have dealt with here, so far, are accounting identities - relationships that are true by definition. And we've just proved the same result that we had previously by another method.

## Model equations¶

Okay, some we've got an accounting framework that helps to ensure that things are water-tight. Now we can derive some equations that can be used to enumerate our model. We can use the accounting framework to pick through what equations we need.

We have 6 unknown variables: $Y, C, G, T, H_h, H_g$. This means we need 6 equations to be able to solve them. So let's try to derive some. It will require us to specify some assumptions about how sectors in our model behave.

First, though, we can make some progress simply with our accounting framework, We know, for example, that:

$Y = C + G$

And we can also easily see that:

$\Delta H_h = Y - T - C$

and

$\Delta H_g = G - T$

Now, the latter two expressions describe changes in the respective money stocks of specific sectors occuring within whatever time period we are considering. Knowing by how much a stock changes is not the same as knowing the actual size of the stock. To know the new size of the stock we need to understand what the original size was before the change. So, if a stock changes by a particular value then we need to add that change to the original size of the stock to get the new size. In other words, we can say:

$H_{h,t} = H_{h, t-1} + \Delta H_h = H_{h, t-1} + Y_t - T_t - C_t$

and

$H_{g,t} = H_{g, t-1} + \Delta H_g = H_{g, t-1} + G_t - T_t$

where the suffixes allow us to link quantities in one time period to those in others. $_t$ refers to the time period under consideration, whereas $_{t-1}$ refers to the previous timestep. So,

$H_{g,t} = H_{g, t-1} + G_t - T_t$

means that the total amount of net government spending (i.e. net of tax) up to this time period ($H_{g,t}$) is equal to the the net amount up to the previous period ($H_{g,t-1}$) plus the amount in this period ($\Delta H_g$ or $G_t - T_t$).

So far we've established:

1 $Y = G + C$
2 $H_{h,t} = H_{h, t-1} + Y_t - T_t - C_t$
3 $H_{g,t} = H_{g, t-1} + G_t - T_t$

This is good progress, we've defined expressions for three of our variables, but we taken our accounting framework as far as we can. For the other unknown variables we need to introduce some new assumptions that go beyond simple accountancy. These are behavioural assumptions.

First, we'll state that government spending is simply a constant value in each time period. That is, the policy, the behaviour, of the government is to spend at a constant rate. We can formally denote this as:

$G = G$

which is rather redundant, but simply means that we'll give it a value ourselves. Its an exogenous variable. When we get around to enumerating our model we'll pop a value in.

Next, tax. We'll assume that the government collects tax as a proportion of income. So:

$T = \theta Y$

where $\theta$ is the tax rate ($0 < \theta < 1$).

Finally, $C$ is a bit more complicated. We'll say that folk spend some proportion of their after-tax income ($Y - T$). So:

$C = \alpha (Y - T)= \alpha (1 - \theta)Y$

where $\alpha$ is the fraction of income which is spent, typically referred to as the propensity to consume ($0 < \alpha < 1$).

So in summary, our six basic equations are:

1 $Y = G + C$
2 $G = G$
3 $T = \theta Y$
4 $C = \alpha (1 - \theta)Y$
5 $H_{h,t} = H_{h, t-1} + Y_t - T_t - C_t$
6 $H_{g,t} = H_{g, t-1} + G_t - T_t$

Now, most of those equations are trival to solve, but equations 1 and 4 are circular - they both refer to $Y$ and $C$ and none of our other equations define those values. However, we can easily solve them by substitution, yielding:

$$Y = \frac {G}{1 - \alpha(1 - \theta)}$$

This describes aggregate income solely in terms of values that we will know (the government spending rate and the tax rate) and includes all the compounding effects of the fiscal multiplier. So we will use this equation in our model solution and from that we can calculate $C$.

1 $Y = \frac {G}{1 - \alpha(1 - \theta)}$
2 $G = G$
3 $T = \theta Y$
4 $C = \alpha (1 - \theta)Y$
5 $H_{h,t} = H_{h, t-1} + Y_t - T_t - C_t$
6 $H_{g,t} = H_{g, t-1} + G_t - T_t$

These equation can now be solved for successive time periods.

## A model in Python¶

We're going to iterate through some number of time steps and solve our equations on each one, then see where these equations take our economy. We'll keep track of all the variables through time so we can analyse them afterwards.

Okay, let's code it up... We're going to use the Python libraries numpy and matplotlib, so we import them first. numpy might be a little overkill for our purposes here but we'll get used to it now as it might be useful in more complex models. matplotlib will allow us to produce graphs of our model solution.

In :
import matplotlib.pyplot as plt
import numpy as np
%matplotlib inline


Next, we'll define the number of timesteps we want to propagate our model through. Let's go for 100. We'll use a variable called N.

In :
N = 100


Next, we'll specify our exogenous variables - $G, \theta, \alpha$. These are the variabiles that are defined by the modeller and represent conditions imposed on the model. These variables do not change through the course of the model run (unless we choose to change them). So we'll define the government's fiscal policy, that is the level of government spending ($G$) and the tax rate ($\theta$), first. We'll go for 20 pounds and 20% respectively.

In :
G     = 20  # government spending
theta = 0.2 # tax rate


And now we'll set the propensity to consume ($\alpha$) at 0.9 - that is, folk choose to spend 90% of their (after-tax) income, saving the rest.

In :
alpha = 0.9


Now, the unknown variables ($Y, T, C, H_h, H_g$) clearly cannot be set by ourselves at this point. These are the variables that are determined by the internal logic and dynamics of the model, the ones we want the model to solve for us. We call these endogenous variables. What we need to do is to establish some containers to hold the values of these variables as we solve the model at each time step. So, we will create Python arrays of length N to store the solved values for each time step. We'll use the numpy .zeros() function to create arrays initially populated by zeros. As the model iterates, these values will be replaced by the values that the model determines.

In :
Y   = np.zeros(N) # income
T   = np.zeros(N) # tax revenue
C   = np.zeros(N) # consumption
H_h = np.zeros(N) # private savings
H_g = np.zeros(N) # government balance


Now were in a position to iterate through each time step and solve the equations, populating our arrays as we go. We use a Python for loop.

In :
for t in range(0, N):

# calculate total income for this time step (equation 1)
Y[t] = G/(1 - alpha*(1-theta))

# calculate the tax paid on income for this time step (3)
T[t] = theta * Y[t]

# calculate the consumption spending for this time step (4)
C[t] = alpha*(1 - theta)*Y[t]

# calculate the new level of private savings for this time step (5)
H_h[t] = H_h[t-1] + Y[t] - T[t] - C[t]

# calculate the new level of government money balance (6)
H_g[t] = H_g[t-1] + T[t]- G



That's it! We've solved the entire history of our economy. Okay, there's a lot to keep track of. Let's make a few plots.

In :
# initialise plot figure
fig = plt.figure(figsize=(12, 4))

# plot government spending (G) through time
gov_plot = fig.add_subplot(131, xlim=(0, N), ylim=(0, 100))         # set axis limits
gov_plot.plot(range(N), np.repeat(G,N), lw=3)                       # plot constant G versus time
gov_plot.grid()                                                     # add gridlines
plt.xlabel('time')                                                  # label x axis
plt.ylabel('government spending')                                   # label y axis

# plot consumption spending (C) through time
consumption_plot = fig.add_subplot(132, xlim=(0, N), ylim=(0, 100)) # set axis limits
consumption_plot.plot(range(N), C, lw=3)                            # plot C versus time
consumption_plot.grid()                                             # add gridlines
plt.xlabel('time')                                                  # label x axis
plt.ylabel('consumption')                                           # label y axis

# plot aggregate income (Y) through time
income_plot = fig.add_subplot(133, xlim=(0, N), ylim=(0, 100))      # set axis limits
income_plot.plot(range(N), Y, lw=3)                                 # plot Y versus time
income_plot.grid()                                                  # add gridlines
plt.xlabel('time')                                                  # label x axis
plt.ylabel('income')                                                # label y axis

plt.tight_layout() # space subplots neatly These three plots show the level of government spending, consumption spending and aggregate income through the 100 time steps of our model. There are a couple of things to note. First, the size of aggregate income can be seen to be the sum of the other two components. This is basically an expression of the equation $Y = G + C$ in graph form - aggregate income is made of income from government spending and consumption spending. Let's check the values of each of these components. We'll inspect the first values in our modelled results:

In :
print(G)    # this is a constant
print(C) # first time period - index 0
print(Y) # first time period - index 0

20
51.4285714286
71.4285714286


Sure enough, we see that aggregate income in the first time period is 71 pounds, which is equal to government spending plus consumption spending ($20 + 51$). Note that these numbers reflect the fiscal multiplier process whereby the money spent into circulation by the government is repeatedly re-spent and incrementally taxed and saved, causing aggregate incomes to be compounded up to 71 pounds. This compounding multiplier process occurs separately within each time period.

The second thing to notice is that, through each successive time step, spending and income levels are the same. This is simply because the exact same dynamics are at play in each time step, there is nothing to change the situation as the model evolves. In each time step, the government spends 20 pounds in to the economy and this circulates according to the same mechanics, yielding the same results. So this is a quite uninteresting economy in that respect. But let's looks at what else is happening.

Let's plot the governments spending and tax revenue through time.

In :
# initialise plot figure
fig = plt.figure(figsize=(8, 4))

gov_plot = fig.add_subplot(121, xlim=(0, N), ylim=(0, np.max(G)*1.5))   # set axis limits
gov_plot.plot(range(N), np.repeat(G,N), lw=3)                           # plot constant G versus time
gov_plot.grid()                                                         # add gridlines
plt.xlabel('time')                                                      # label x axis
plt.ylabel('government spending')                                       # label y axis

tax_plot = fig.add_subplot(122, xlim=(0, N), ylim=(0, np.max(G)*1.5))   # set axis limits
tax_plot.plot(range(N), T, lw=3)                                        # plot tax revenue versus time
tax_plot.grid()                                                         # add gridlines
plt.xlabel('time')                                                      # label x axis
plt.ylabel('tax revenue')                                               # label y axis

plt.tight_layout() # space subplots neatly Okay, we knew that government spending was contant through time (we set it to be). We can also see that tax revenue is also constant in each time step. Again, this should come as little surprise: if incomes are consistent through time, we'd expect the associated tax payments to be similarly consistent. The spending and taxation values are:

In :
print(G)
print(T)

20
14.2857142857


So the government has a constant budget deficit, through all time periods, of:

In :
print(T-G)

-5.71428571429


Now this shouldn't come as a suprise to us either, as we've previously discovered that a saving population is associated with a government budget deficit. And in this economy folk are saving 10% ($1 - \alpha; \alpha = 0.9$) of their after-tax income. Let's calculate how much that ultimately amounts to once the full compounding of incomes is achieved within a time period.

In :
Y - T - C # alternative formulation: (1-alpha)*(1-theta)*Y

Out:
5.7142857142857082

As expected, the amount saved within the first time period is the same (within rounding errors) as the government's budget deficit. We don't need to check the other time periods as we can see from the plots that they are invariant in this respect.

Let's plot out the government's budget and the private sectors saving positions, as well as the corresponding cumulative money stocks to get more of a feel for this.

In :
# initialise plot figure
fig = plt.figure(figsize=(8, 4))

budget_plot = fig.add_subplot(121, xlim=(0, N), ylim=(-10, 10))                     # set axis limits
budget_plot.plot(range(N), T-np.repeat(G,N), lw=3)                                  # plot gov budget versus time
budget_plot.plot(range(N), Y-T-C, lw=3)                                             # plot private budget versus time
budget_plot.grid()                                                                  # add gridlines
plt.xlabel('time')                                                                  # label x axis
plt.ylabel('budget position')                                                       # label y axis

balance_plot = fig.add_subplot(122, xlim=(0, N), ylim=(np.min(H_g), np.max(H_h)))   # set axis limits
balance_plot.plot(range(N), H_g, lw=3)                                              # plot gov balance versus time
balance_plot.plot(range(N), H_h, lw=3)                                              # plot private balance versus time
balance_plot.grid()                                                                 # add gridlines
plt.xlabel('time')                                                                  # label x axis
plt.ylabel('money balance')                                                         # label y axis

plt.tight_layout() # space subplots neatly Okay, these plots have a nice symmetry. In each time period, the private sector (green) has a surplus of 5.7 pounds whereas the government (blue) has a deficit of the same amount (left plot). In other words this means that the the private sector saving at a rate of 5.7 pounds per time step and the government is "dissaving" at the same rate. In the right-hand plot we can see how these flows accumulate over time. They are straight lines which reflect the constant flow rates. Over 100 time steps the private sector savings translates into:

In :
print(H_h[-1]) # the -1 index represents the last value in the array

571.428571429


Whereas the government deficits cumulatively represent:

In :
print(H_g[-1])

-571.428571429


Over the course of the model run, the government has spent 571 pounds more than it has taxed. And this matches, to the penny, the amount which the private sector has saved (right plot).

## Summing up¶

Okay, We've built a complete but highly simplified model of an economy consisting of a private sector and a government sector. Our model was built around the concept of the fiscal multiplier, in which the government spends into the economy and this induces subsequent consumption spending, taxation and saving. We simulated this process occuring repeatedly through 100 time periods. Each time step represented a distinct accounting period in which all flows of money were accounted for and any imbalances between a respective sector's inflows and outflows were reconciled as changes in stocks held.

In each accounting period we found that the private sector had larger inflows than outflows. This is because it chose to save some of its income rather than spending it. The government had the opposite: it was spending more than it was receiving in tax during each accounting period. This happened because tax is levied as an income tax and therefore requires spending (income is the mirror-image of spending). If the private sector do not spend all of their income then some money remains untaxed. The only accounting component which is carried across time periods is the value of the money stocks held by the sectors. So since the private sector has a surplus in every accounting period, these surpluses accumulate with each successive time period and their stock of saved money grows continually through time. Likewise, the government's constant spending deficit causes their negative money balance to grow continually through time.

So we have a situation with constant government spending, stable consumption spending and stable income levels, a constant rate of saving driving a persistent government deficit, and consequently a pot of private savings which grows steadily through time and which matches a steadily growing, negative government balance.

We might be tempted to ask, "How can the government spend more than it earned? How much money did the government start with? Where did it get it from? And how much does it have left?". Well we didn't set the model up with a stock of money at all. Yet we did take some care to ensure that our stocks and flows were dilligently accounted for. So how did money appear in the model? Well, what we did when we simulated government spending was to simply account for the spending by marking it as a receipt for the private sector (the business sector, in the first case) and an outlay for the government. This accounting implies the transfer of something between parties that didn't previously exist. This something is effectively an IOU - a record of a promise from one party to another. And since it is government spending that kick-starts the cycle of private consumption spending which gives rise to the fiscal multiplier effect, we can conclude that it is government IOUs that are circulating. Indeed, the entire accounting matrix is denominated in government IOUs. So we didn't start with a stock of money but we can see money in this model as accounting records representing government issued IOUs. The government is the source of money.

So what the private sector accumulates is government IOUs, which explains exactly and quite trivially why the government has an equally sized negative balance - it is the issuer of these IOUs. The private sector and government balances are simply the opposite sides of the same thing.

But if the money in the model is an IOU of the government's, what, exactly, is it an IOU for? What is the government obliged to provide in return for it's IOUs? Well, in this model, there is only one thing that money can be used for with respect to the government and that is paying taxes. So while the private sector's positive balance can be seen as it's accumulated, saved wealth, the government's negative balance can be seen as simply the record of government issued money that has yet to be taxed but that the government must be prepared to accept in return for the extinguishing of future tax obligations. This is the sense in which it is a "liability" or a "debt" of the government.

So, in summary, our model implies the following:

• The money which circulates is government issued IOUs
• The government creates this money when it spends
• Government money is a liability of the government in the sense that it can be redeemed against future tax a obligation
• Government money is effectively cancelled on payment of taxes
• If the private sector chooses to save money out of circulation this will cause an equally sized government budget deficit
• The government "debt" is a record of the outstanding (saved, untaxed) government money that can be returned in payment of taxes

Although this is a simple model which clearly has significant limitations relative to real economies, it is worth reflecting on whether these conclusions are very different to the real world.

Aside from being an obviously simple model, there is one problem that stands out. In this model, the savings of the private sector (and by implication, the government "debt") grows rapidly, seemingly without bound. This is arguably quite unrealistic, if only for the simple reason that when folk save they often spend their savings, at least at some stage, to some extent. This small but significant consideration will be the basis of the next model/post.