The Naïve Inflation Forecaster

Wardwissner
8 min readJul 20, 2022

by Leonard Wissner (Len)

Economic statistics loom large in determining the short- and long-term direction of capital market prices. Two such economic statistics that have captured market participants' attention are the monthly release of nonfarm payroll employment on the first Friday of the month and the release of the prior month’s consumer price index toward the middle of the month. Directional bond and stock traders attempt to position their trading accounts to attempt to exploit any misconceptions between their own forecast and consensus market expectation. When there is a wide divergence between reality and expectations, the markets react violently, thereby presenting trading opportunity.

In the current market setting, participants are particularly cognizant of the direction of inflation. Although long-term trends might require a great deal of economic analysis and statistics, short-term directions over the next one to 3 months might very well be dealt with utilizing time series forecasting models. To my surprise, I have found these time series models, employing a single economic variable, quite effective in capturing short-term market trends and, in many cases, superior to forecasters relying on a variety of economic factors. The purpose of this paper is to describe the two-time series models I use to predict the monthly release of the consumer price index. The first model uses a classical Box Jenkins methodology which was discovered in the 1970s. The second model utilizes a more modern technique, a Gated Recurrent Unit( GRU )using the Keras API. Both models simulate quite well in predicting the monthly release of the consumer price index. Both models suggest a worrisome trend reaching a 9.40% annual growth in consumer prices by August 2022. The beauty of these models lies in their simplicity and ease of construction. All one needs is the historical CPI data and a google collab notebook.

The Historical Record

In Chart one below, I have plotted the annual rate of change in the Consumer Price index monthly since 1913. I have identified six periods when the Consumer Price Index recorded an annual change in excess of 7%. One striking observation is that prices generally rise dramatically during periods of pandemics, war, or oil price shocks in the financial system.

Chart 1-Annual Change in the The Consumer Price Index(NSA) 1913–2022
Chart One

https://fred.stlouisfed.org/series/CPIAUCNS

If we go back to the years 1916–1920, we observe both the Spanish Flu pandemic and World War One. Indeed, the worst period of inflation was observed during these years. The dual forces of pandemic and war are similar to what has been observed in the past 4 years with the Covid 19 pandemic and, more recently, the Russian invasion of Ukraine. Although recent experience is disturbing, hopefully, we will not experience a recurrence of the inflationary trends observed a century ago. Today the Fed is more sophisticated and competent in exercising the tools needed to combat inflation. These tools were successfully utilized under the chairmanship of Paul Volcker in 1980. The tight monetary policy under the Fed was effective in breaking the back of inflation in only two years but at the cost of a steep recession. Those were the years of high inflationary expectation as the country was feeling the effects of a guns and butter policy during the Vietnam war and two Arab oil embargos. Today's Fed has a wider set of tools in its toolkit. In addition to tightening monetary policy, it is also unwinding the quantitative easing policy adopted during the past decade. We enter this inflationary cycle after almost 40 years of low inflation. Hence inflationary expectation is modest compared to the expectation during the Volcker years.

Time Series Forecasting

Time series models are quite effective in predicting short-term economic trends. The models are simple to develop and rely on the notion that past data can be predictive of future behavior. In the 1970’s a technique developed by Box Jenkins( Box, George; Jenkins, Gwilym 1970 Time Series Analysis: Forecasting and Control. San Francisco: Holden-Day ) was an eloquent exposition on the development of time series forecasting models.

The first step in the model development is to observe the raw CPI data from 1913 to May 2022 and develop a transformation of the data to achieve stationarity. To remove the trend in the CPI index, I looked at the change in the log of the CPI each month. This is equivalent to looking at the percent change in the monthly non-seasonally adjusted CPI index. Note the large fluctuation in the monthly change in the CPI index in the years 1918–1920, much larger fluctuations than observed even recently.

Chart Two

Looking at the correlation and partial correlation graphs of the change in the log of the CPI, it became evident that a seasonally adjusted autoregressive model should be chosen. Note the autocorrelation function exhibits an exponential decline with significant partial autocorrelation at lags 1–4 and 12,24,36. This suggests we need to remove the seasonal effect at lag 12, and the changes in the CPI in the previous 4 months are predictive of the change in the next month’s CPI. In short, a seasonally adjusted Autoregressive Model sarima(4,1,0) would satisfactory model the log of the CPI index.

Chart 3

After fitting this model, we are left with normally distributed white noise residuals.

Chart 4

NormaltestResult(statistic=3742.1839508108715, pvalue=0.0)

We then tested our sarima(4,1,0) model on monthly data from 2011 to May 2022. Each month the model was fit on past data, and a 1 month forward forecast was generated. A plot of the error in the monthly forecasted CPI level from the actual CPI is shown in the graph below. The model can predict the monthly CPI index with a standard error of about ¾ point. This translates to approximately 1/3% error in the annual CPI growth rate. The model had difficulties in 2022, with a deviation in excess of 2 points or ¾% in the annual rate of growth in the CPI in March 2022.

Chart 5

What does the model suggest for the coming quarter? This is shown in table 1 below. This model suggests a disturbing inflation trend over the next 3 months, rising to an annual rate in excess of 9% by August 2022. The Fed task is formidable in the months ahead.

Table 1

Sequence Models

Recurrent neural networks(RNNs) and their variations have been quite useful, particularly in language processing. Ever wonder how the next word is suggested when you are composing a text on your smartphone? This is one of many applications of RNNs. An excellent description of RNNs and their variations can be found in https://colah.github.io/posts/2015-08-Understanding-LSTMs/ by Chrystopher Olah. After testing the many variations of Rnn’s, I settled on the Gated Recurrent Unit(GRU) introduced by Cho et al. in 2014.

A common feature of all RNNs is the decision of the time sequence to use. Based on my prior work with the SARIMA model, I chose a time sequence of the previous 12 months of changes in CPI to predict the current month’s CPI. One could use the raw CPI data and construct a GPU using the Keras API; however, the results will prove quite unsatisfactory. Modeling the change in the log of CPI proved to be quite successful.

My first task was to preprocess the 1300 sequences of 12 months of data from 1913-May 2022. Each sequence of 12 months, representing the change in the log data, was preprocessed using the keras minmax scaler.

scaler = MinMaxScaler(feature_range=(0, 1))

data = scaler.fit_transform(data.reshape(-1,1))

A training set consisting of 90% of this data, Jan 2013-July 2011, and a testing set August 2011-May 2022, was formed and fed into the Keras GPU model described below.

Table 2

I was quite impressed with how well the model generalized on the test data from August 2011 to May 2022. The predicted CPI level tracked very closely to the actual CPI from 2011 to May 2022 with a stdev of the error in the CPI monthly forecast of only ¾ point, and the model was not retrained with recent data! The trained model from 1913 to July 2011 was used throughout the simulation test.

Chart 6

The GPU model paints a grimmer picture over the next 3 months, with the CPI growing at an annual rate of 9.40% by August 2022.

Table 3

Both models point to a challenging setting for the Fed in the coming quarter. But there is something keeping me up at night. What I find most disturbing is the fact that Chart One suggests we have experienced periods of much higher inflation in our economic history than observed today. Indeed, the period from 1916–1920 witnessed annual rates of growth in the CPI of 10–20%. This was a time of both war and pandemics, similar to the experience we observed in the past four years. However, the Fed was in its infancy a century ago. Central bankers across the world are more experienced in dealing with inflation. I am optimistic they will rise to the formidable task ahead.

Stop the press! The June CPI has been released at 296.311 and a 9.06% annual rate of growth, even worse than expected by our GPU model. If you enjoyed this paper as much as I have in creating it, please send me your comments. I would love to share with you my upcoming naive inflation forecast.

--

--

Wardwissner

ACCOMPLISHMENTS Pioneer in the development of bond portfolio immunization strategies -mathematical portfolio selection techniques to protect a bond portfolio