Sunday, March 24, 2013

Simulating Hyperinflation

I have a model for simulating the mechanics of how hyperinflation works.  A simple set of reasonable linear formulas and feedback loops between them can cause the non-linear behavior similar to what is observed in real world hyperinflation.  Below is an earlier image of the model.  The key point is that hyperinflation emerges mechanically from macroeconomic processes gone wrong.

The key equation behind the model is the equation of exchange, that relates the money supply, the velocity of money, the real GNP, and the price level.  This formula is used to calculate the "Price Level" in my model.

The other key is that the velocity of money depends on the inflation rate and interest rate.   Hussman has shown that the velocity of money depends on the interest rate.   Previous hyperinflations have shown that the velocity depends on the inflation rate.    So my formula has it depend on both.

You can play with the simulation here.   To see all the formulas, and explanations for most, click on "clone insight" and then put your mouse over a node and click the "=" that shows up.

The overall behaviour of the model is correct.  With too much debt and deficit the inflation rate gets out of control.  I think it is a great way to understand the feedback issues in hyperinflation.  There are at least 5 feedback loops you can see in this model.  You can see how the velocity of money affects the price level but the price level changes mean changes in the inflation rate, which affects the velocity of money.  Also how the nominal GNP going up will cause government spending to go up, which increases the money supply (if input for "spending to taxes" is more than 1), which increase inflation, which increases nominal GNP.    Or how bond holders are looking at the inflation rate but their decision not to roll over bonds results in an increase in the money supply, a higher price level, and more inflation.  Also, hyperinflation lowers the real GNP,  which makes inflation worse.  The spending relative to taxes gets worse as hyperinflation progresses, which contributes to inflation.  So these 5 hyperinflation feedback loops are very visible in the diagram and in the results of the simulation.

Note that nowhere in the model is there a "now the people in control vote for hyperinflation" node.  Not a single "war starts now".  No "debt in foreign currencies".  No place do I have "people vote themselves money from the public till".  Nothing about "crazy dictator takes over" etc.   No "demand for money goes down" or "confidence in money drops".  Many of the common explanations for hyperinflation are not directly modeled but the behavior of the model matches each of them anyway.

There are many different ways to get to the starting conditions of a government with high debt and deficit but how you get there does not matter for the simulation of what happens next.  Once the conditions are right, hyperinflation can just happen.

One could argue about the details of the formulas at different nodes, and I am open to suggestions for better formulas.   Because there are 5 different feedback loops in this model, changing a formula so much that you break one loop will still not prevent hyperinflation, just delay it.     In the real world  hyperinflation makes the real GNP go down.  I have it go down for a bit as inflation goes up and then bottom out. My function for people deciding to roll over bonds uses the inflation rate and the interest rate.   If bonds are a bad deal people don't want them.  Again, the details of when a bond panic happens are not the point of this simulation.   But a key part of hyperinflation is a central bank printing money when the government does not have money for the deficit or the bonds coming due.     

The model has a few assumptions, of course.  It assumes that if the government is running a deficit that any bonds not being privately bought are bought by the central bank.  I think this is just an accounting identity.  If the central bank makes the money and the government is spending more money than it is taking in then it must be that the central bank is giving money to the government.  In this view the central bank printing is sort of a dependent variable.  In real hyperinflation this is what happens, the central bank must print to support the government.   It simplifies the model to do it this way.

Another way I like to think about it is as if the central bank was part of the government and all money from taxes or bond sales was burned and all money for spending and bond redemptions was newly printed.  A government could theoretically do this.  It makes it very clear that changes in the money supply come from the difference between taxes and spending and changes in bond holdings.

The point of the model is that when a government has a large debt and deficit they can lose control of the money supply.  They just have to print money if not enough people are buying bonds.  But as they do this the money supply goes up,  the velocity of money goes up, the real GNP goes down, fewer people want to hold bonds, and the inflation rate goes up really really fast.  You can get a positive feedback loop.  This model can show this dynamic.  Kind of fun.

In the simulation you can set inputs on the right and then click "run simulation" on the top.   A window will pop up showing a graph.  There are tabs on it to see other graphs.  One of the tabs is "Big Table" and it has a big table with values for many of the nodes in the simulation.    In the top right you can click "clone insight" and make your own copy of the simulation where you can change any formulas or anything you want.

At some point people are in a hurry to get out of bonds.  You can see that in these results.  These results are for "spending to taxes" at 1.339, "yearly interest rate %" at 3.12.

First the money supply:

Then the price level, notice how it is up by around a factor of 10 when the money supply was only up by around a factor of 3:

Then yearly inflation factor (1 means no inflation).  In this simulation this is really the inflation so far that year, not the inflation rate at that moment:

Velocity of money:

Bond redemptions.  They go up and then reach as short term bonds are finished and then bonds are redeemed as they come due. 

If the interest rate drops fast enough then it can make the velocity of money drop  fast enough that there is no inflation even when the money supply is increasing fast.  This can only go on for awhile as eventually you get to 0 interest rate. 

There is nothing in this simulation for "bank created money".  This type of money does not seem significant during hyperinflation as banks do shorter and shorter term loans as inflation gets higher and higher.  However, this type of money does help explain the deflation that often comes before hyperinflation.

Please note that no attempt has yet been made to match the timing of the real world.  In the model, when there is more money the prices go up the next day, then the velocity the day after that, etc.   In the real world there are "long and variable delays" (Friedman) between when money is created and when it impacts prices.  Conditions that result in hyperinflation in less  than 1 year in this model could take many years to get to hyperinflation in the real world.

If someone has historical data for hyperinflations that includes money supply, velocity of money, bond holdings, and price level I would be very appreciative of a copy or pointers to this.  If this model were made to match several historical hyperinflations then it could be useful for predicting the timing on future hyperinflations.   If anyone else wants to start with my model and do this you have my blessing.   

For more on hyperinflation please see my Hyperinflation FAQ or my Hyperinflation Explained Many Different Ways.

I would also like to put in a plug for  I think Insight Maker is a really nice tool for this sort of thing.   Do try it out.  You can "clone insight" and have a copy of my simulation to play with.  Change formulas and all.  I would love to have people try to improve the simulation and then post on their blog what they did to improve the simulation.  Please post a link in the comments here if you do that.  If you don't think hyperinflation is a problem please try to correct the formulas till you don't get hyperinflation and then post about what changes you made.

There are some academic models of hyperinflation.  For example, Modeling Hyperinflation Phenomenon: A Bayesian AproachThe Hyperinflation Model of Money Demand Revisited , or A Model of Hyperinflation.   These also references other papers.  I think my model is far closer to modeling reality than the other stuff I have seen.   The quantities in my model are based on real things in the real world, like taxes, bond redemptions, money supply, velocity of money, etc.   Other models are based on more abstract things like "demand for money",  "negative inflation elasticity", or "crisis of confidence". 

Paul Krugman has asked for a model of how too much debt can lead to trouble in a country that prints its own currency.  In fact krugman has said "show me the model" many times.    I keep posting a comment with a link to my model but he keeps asking for a model, as if he did not know of my model.   I can only assume that he does not read the comments to his posts.   If anyone knows of some way to get through to him, please tell him about my model.  He says he wants to know about such a model.

Update 2016/01/02:
   More evidence that the velocity of money depends on the interest rate.

Formulas from Model

Here are the formulas from the model in case someone does not want to bother click on "clone insight". I have no doubt that you can find things that you think should be different.  However, I claim that you can change all kinds of details to more reasonable formulas and still get high inflation when there is too much debt and deficit.  So please, before posting and trashing some particular formula or constant, please try the model with the change you are thinking of and see if it really makes much difference.

In many cases the formulas in the model are complicated by the need to handle the initial startup conditions for the model.  In many cases things are done differently the first few iterations of the simulation.  In the actual model you can see this with things like "IfThenElse( Days < 5, X,  Y)".    The "Y" is the meat of the model.  Below I am just showing the "Y".    You don't need to see how I handle the initial startup really.

Also, "delay" just means the value from a previous iteration.

If you do "clone insight" and make any changes that you think improve the formulas, please comment below with a link to your model.

Feel free to ask questions.

Price Level=[Money Supply]*delay([Velocity of Money],1,1)/[Real GNP]
# This comes from the economics formula called the "equation of exchange".
# This is key for understanding the math of hyperinflation.  Look at:

Velocity of Money=Abs(2*([Yearly Inflation Factor]+[Yearly Interest Factor]))
# See Hussman on how interest rate influences velocity of money
# In hyperinflation the inflation rate
#  also influences velocity
# Note that when Fed forces interest
#  down it lowers velocity, at first

Yearly Inflation Factor=1+sum(pastValues([Daily Inflation]))
# really this is an approximation for inflation so far this year
# The daily inflations should be multiplied or we should work off the price level to be more accurate
#  This is conservative, inflation is really worse than this

Daily Inflation=[Price Level]/delay([Price Level],1,1)-1

Change in Interest=IfThenElse([Days to 0 interest]=0, 0, -1*[Yearly Interest Rate %]/[Days to 0 interest])

Federal Deficit= [Daily Taxes]*[Spending to taxes]-[Daily Taxes]
# Positive then money supply is increasing
# Imagine they burn money from taxes and print all money they spend
# Then deficit is net increase in money

Daily Federal Deficit=[Daily Taxes]*[Spending to taxes]-[Daily Taxes]
# Positive then money supply is increasing
# Imagine they burn money from taxes and print all money they spend
# Then deficit is net increase in money

Initial Spending To Taxes = 1.56

Spending To Taxes=IfThenElse([Yearly Inflation Factor]<1,[Initial Spending to Taxes],[Initial Spending to Taxes]+([Yearly Inflation Factor]-1)/3)
# As hyperinflation makes economy worse the spending relative to taxes goes up

# This stock is debt from deficit spending
# Does not account for debt from bond redemptions
# This starts at national debt
# Note this stock can go negative and probably always is

Private Bond Holdings plus excess reserves=10000000000000

Net Bond Redemptions= [Private Bond Holdings plus excess reserves]*(1-[Daily Rollover Rate])
# You can imagine that the government burns all money from bond sales and prints all money for bond redemptions
# So net redemptions increases money supply

Money Supply=10412000000000
# Money supply here should be thought of as money outside the Fed or government
# You can imagine that the government burns all money collected from taxes or bond sales and prints all money used for spending or paying off bonds.

# We start with M2

Daily Rollover Rate=IfThenElse([Yearly Rollover Rate]<1/2, 1-1/365, 1+([Yearly Rollover Rate]-1)/365)

Yearly Rollover Rate=1.02+[Yearly Interest Factor]-[Yearly Inflation Factor]
#  People get paid interest on their bonds.
# This increases the money supply.
#  For this simulation that is just part of the government budget.
# Once hyperinflation gets going the value of private bonds soon becomes very small.
# So I don't think this is important.
# Idea in this formula is that people
#   will increase bond holdings if the
#   interest is higher than inflation and
#   decrease if is less than inflation.

Yearly Interest Factor=IfThenElse(days<[Days to 0 interest],1+([Yearly Interest Rate %]+days*[Change in Interest])/100, 1)

Yearly Interest Rate %=4.31

Days to 0 interest=50

Real GNP=IfThenElse([Yearly Inflation Factor]<1.3, [Initial Real GNP], IfThenElse([Yearly Inflation Factor]>3, [Initial Real GNP]/2.3, [Initial Real GNP]/([Yearly Inflation Factor]/1.3)))
# for low levels of inflation we use initial real GNP
# for early hyperinflation we reduce GNP by inflation factor over 1.3
# for high hyperinflation we reduce GNP by fixed factor of 2.3

Nominal GNP=[Real GNP]*[Price Level]

Initial Real GNP=15990000000000

Daily Taxes=[Tax as percentage of GNP]/100*[Nominal GNP]/365
#  We assume taxes are a fixed percentage of Nominal GNP
#  In real hyperinflation much of the economy goes black market to avoid taxes
# So really it is worse than this simulation
# Taxes will be less and printing more

Taxes as percentage of GNP=33.49