Wednesday, March 19, 2014

ƛ


Yesterday I took the growth rate of employment, scaled it to the same amplitude as the growth rate of household debt, and centered the one line on the other. This process stripped away differences between the two lines, other than differences of pattern. That permitted me to compare the patterns of the two datasets.

So then I subtracted the one from the other, to see the difference. The blue line on the graph below shows the difference value. The red line is a Hodrick-Prescott trend line:

Graph #1: "Fitted" Employment Growth Date Less Debt Growth Rate (blue)
and a Hodrick-Prescott Trend (red)
You might have expected to see something like this:

Graph #2: The same data, but the HP calc uses a different value for  lambda
Almost the same. The blue line is the same. The red line is a little bit more wiggly. The big difference is in the legend, where the lambda value has changed from ten thousand to sixteen hundred.

The lambda is a constant used in the HP calculation. I don't know why they call it lambda. But it seems to be pretty important. It seems to be always reported in the notes that accompany graphs that show HP trend lines.

As I noted almost a year ago now, there is apparently a "rule of thumb" for picking a lambda value. It depends on the frequency of the data. For yearly values, a low number (100), for quarterly data higher (1600), for monthly data higher yet (14400).

I already know, from looking at the two graphs above, that the lambda value determines how much "smoothing" you get in the graph. A higher number gives more smoothing.

So I thought I'd look at a variety of lambda values, all applied to the same data. The source data here is quarterly, which means the rule-of-thumb lambda constant would be 1600. Here's what happened when I changed the constant:

Graph #3: Lambda = 100

Graph #4: Lambda = 1000

Graph #5: Lambda = 10,000

Graph #6: Lambda = 100,000

I used to think I should stick to the rule-of-thumb values as a rule. Now I think those values are just a starting point. If I really want to see the trend, I can increase the lambda until the little wiggles go away. And yeah, if you're going to be using non-standard lambda values, then that's a good reason to always report it in the notes that accompany the graph.

//

Preview or Download the Excel file from Google Drive. Note that the file contains my Visual Basic macros for formatting my graphs, and Kurt Annen's Visual Basic for the Hodrick Prescott calculation. Also, above the graph it says 1600 LAMBDA. Change that number from 1600 to some other value, and you change the graph.

// Update 30 March 2014: For my intro to the Hodrick-Prescott calculation, a link to an Excel add-in, a how-to-use link, and a link to some tips, see De-Trending.

No comments: