Monday, November 25, 2013

How to Change the Past

I've fiddled with Hodrick-Prescott trend lines a bit, and one thing I noticed is that they have a sorry kind of foresight. They can predict the future -- but only in hindsight.

I did a post a while ago -- a post named Hindsight, actually -- in which I showed this FRED graph:

Graph #1: Natural Log of the Inflation-Adjusted Change in "Total Credit Market Debt Owed"
Then I showed the same graph in Excel, with a Hodrick Prescott trendline added in:

Graph #2: Same as Graph #1, with Hodrick-Prescott Trend thru 4th Quarter 2007
I stopped the trend line at the high point of the blue line, and wrote:

I stopped the HP calc at that point so that the later decline did not drag down the earlier years' numbers.

So that the later decline did not drag down the earlier years' numbers.

The HP calc is entered in Excel as an "array formula". It takes as input a whole series of FRED data. For Graph #2, I fed it data from 4th Quarter 1952 to 4th Quarter 2007.

For Graph #3, I fed it data from 4th Quarter 1952 to 4th Quarter 2012. That's the only difference.

Graph #3: The Blue Line is the Same as on Graph #2, but the Red Line Continues to 4th Quarter 2012
Notice that the red line no longer reaches up to the high blue peak. The red line bends down early now, around 2004, and begins the plunge while the blue line is still trending up to its high peak. The trend line anticipates the future.

Adding data for the years after 2007 to the Hodrick-Prescott calculation changed the results we got for a few years before 2007. If that's not a sorry kind of foresight, I don't know what is!

Another example, this from A second look at the heteconomist post:

Graph #4: Percent Change in the Non-Federal Portion of TCMDO (blue) and the H-P trend (red)

The red line on Graph #4 is a Hodrick-Prescott trend of the debt data through 2007. Graph #5 shows the same debt data, and the H-P trend again, but this time the trend is based on all the data through 2012:

Graph #5: Same as Graph #4, except the H-P Trend is figured through 2012
On Graph #4 the red line trends upward for the last few years before the 2007 end. On Graph #5 the red line runs flat until about 2004, when it starts to fall.

The decline since 2004 on this graph is the result of figuring in data for 2008-2012. Look at it from the start of 2008, and it appears that the future changes the past.

The Excel files, on Google Drive:

NonFederal Debt Growth.xls for the "Change in Non-Federal Debt" graph.
dTCMDO rel GDPDEF.xls for the "Log of Change in TCMDO" graph.

Both files contain Kurt Annen's VBA code for the Hodrick Prescott calculation.


Jerry said...

I think this is just how a sliding window average works. It looks like it's averaging over maybe an 8-10 year period? If it bothers you, you could stop the red line 4-5 years before you stop the blue line. Because you don't have the data to figure what the red line will really be, yet.

The Arthurian said...

Agreed! I was thinking of following up with a look at moving averages of the blue lines. They would have to be similar to the HP, falling before the blue lines themselves fall.

Some other data could no doubt show early indications of the precipice visible on these debt graphs. But it still strikes me as wrong that the HP filter seems to show early indications that the unfiltered values do not show.

We talked before about how trends don't have to have points of intersection where a change takes place. I think this is typically true for economic forces. If one set of forces remains dominant while another is rising, the result should be a gradual but increasing transition from the one set of forces to the other. Not a crisis point like the blue debt lines show in the above graphs.

In our case the crisis was pretty much a crisis. Rising sets of forces were overlooked by policymakers, or treated as minor impediments in the desired path. But there came a time when the dominant forces could retain their dominance no longer, and the change was then sudden. This is how the world is. But it is not what the HP trend shows.

The Arthurian said...

Also I think it is important to point out the way the HP filter works.