Friday, April 12, 2013

Seeing for myself

I looked before at the Econbrowser guest post The Myth of 'Jobless Recoveries' by Laurence Ball (Johns Hopkins University), Daniel Leigh (IMF) and Prakash Loungani (IMF).

Since then I found Kurt Annen's Visual BASIC code for calculating Hodrick Prescott values. So now I can try again to duplicate the graphs from the Econbrowser post, and maybe learn more about them.

From that post:
Using annual U.S. data from 1948 to 2011, we find that the Okun’s Law has a coefficient of –0.4 or –0.5, with an R2 in the neighborhood of 0.8. Chart 1 illustrates the fit of the estimated Okun’s Law by plotting the unemployment gap (the gap between unemployment and the natural rate) against the output gap (output relative to potential). The relationship is very tight. No year is a major outlier in the graphs.

Chart 1. United States: Okun’s Law, 1948-2011 (Annual data) (Natural Rates Based on Hodrick-Prescott (HP) Filter with λ = 100)

NOTE: In the Econbrowser article the text reads "...a coefficient of –0.4 or –0.5, with an in the neighborhood of 0.8." Something is obviously missing between the words "an" and "in". I tracked down Laurence Ball at IDEAS, clicked the IMF link to paper, opened the PDF Okun's Law: Fit at 50?, and searched it for the phrase "coefficient of –0.4". Yup, what's missing is "R-squared", given in the PDF as capital R with an overbar, followed by a superscript 2. So I inserted that into the Econbrowser excerpt.

I went to FRED for "annual" data on "unemployment" and "output". Retrieved the seasonally adjusted Civilian Unemployment Rate UNRATE and seasonally adjusted Real Gross Domestic Product GDPC1. For both I selected "annual" data and the default aggregation method, "average". Used Excel to calculate the Hodrick Prescott values and figure the gaps -- the differences between the FRED values and the HP values. Created a scatterplot showing gap versus gap:

Graph #2

Well I'll be darned. The chart's a good match. I got my axes the wrong way around from Chart 1, but the data points are definitely grouped along the trend line, and I even got an R2 comparable to the 0.8 reported in the Econbrowser post. And no major outliers.


Okay. What I'm looking at is the difference of output values from their trend, versus the difference of unemployment values from their trend. I have to think about it a while.

Two points.

1. On my graph, the unemployment gap values range roughly from 2 to -2, or a difference of four percentage points. And the output gap values range roughly from 4 to -4, a difference of 8 percentage points. Roughly, the change in output is twice the change in unemployment. This agrees with Okun's law.

2. The output gap for this exercise is assumed to be the difference between inflation-adjusted output, and the trend of that output. In other applications, the output gap is taken to be the difference between inflation-adjusted output and potential output, which is not the same as the trend of realized output.

According to CBO's A Summary of Alternative Methods for Estimating Potential GDP (PDF),

Statistical filters (such as centered moving averages, bandpass filters, the Hodrick-Prescott filter, and the Kalman filter) are often used to extract the trend from GDP directly. These methods do not generally use Okun’s law...

Having actually used the HP filter now two or three times, having seen it for myself, I understand this better and I see it applies to the work of Laurence Ball et al. Ball's work is *not* circular because he uses an alternative to CBO's calculation, one that does not use Okun's law.

And yet, as the CBO paper states:

There are many ways to estimate the trend in GDP (and other economic data) as well as to compute the economy’s productive potential. Some methods rely on purely statistical techniques. Others, such as CBO’s method, rely on models guided by economic theory. Many methods used to compute potential output do not benchmark their trends to inflation or any independent measure of capacity and therefore cannot be interpreted as estimating the level of maximum sustainable output. That is, they provide a measure of trend output but not potential output.

If we, Laurence Ball and I, are not measuring the output gap as the difference from potential output, then we are likely understating the size of the gap.

If there is a long-term trend of decline in realized GDP, as I believe, then there may be a long-term increase in the size of the output gap that we are understating.

Thought about it. Given the actual unemployment we've had over the years, it is reasonable to draw a "trend line" that minimizes the actual variations, and helps us picture the general trend. Likewise output.

And then is is interesting to compare the differences-from-trend of unemployment against the differences-from-trend of output. This is what we see in the above graphs. There is nothing circular in the arithmetic, that I can see. And the correlation appears to be strong.

Regarding the second graph in the Econbrowser post, we read:
Our finding of a stable Okun’s Law is robust to various methods of measuring short-run movements in output and unemployment. We try alternatives to the Hodrick Prescott (HP) filter. We also estimate the relationship in “changes”, that is between the change in the unemployment rate and the change in (log) output, which does not require using the HP or any other filter. The relationship holds for quarterly as well as annual data. Chart 2 shows the tight fit between actual unemployment and the estimate based on Okun’s Law. Some residuals are evident during the early years of the Great Recession, for which Ferrara and Mignon provide some conjectures.

Chart 2. United States: Actual and Fitted Unemployment Rate, 1948Q2-2011Q4. Notes: Figure reports fitted unemployment rate from Okun specification estimated on quarterly data in levels with two lags and natural rates based on Hodrick-Prescott filter with λ = 100.

Trying to get clear on what they're saying. This part is easy: "Chart 2 shows the tight fit between actual unemployment and the estimate based on Okun’s Law." In this case, they definitely *are* using Okun's law to determine "fitted" unemployment.

The note below the graph refers to "levels with two lags" which must be some specific detail of the calculation, but the meaning escapes me.

The note below also refers to "natural rates based on Hodrick-Prescott". Rates, plural, so I think they figured HP trends for both output and unemployment, and used these somehow in their calculation. Then Okun's law comes into play. Working it backwards, they use the output gap to estimate unemployment. They call this estimate "fitted" unemployment, and they compare it to "actual" unemployment in their graph.

Okay. I think I figured out a way to estimate unemployment numbers using Okun's law and the HP trends. In my post (linked at the top) I wrote:

To figure potential output, the Congressional Budget Office uses the unemployment gap. They take that gap and stretch it to fit over actual output. That gives them the output gap. The output gap looks like the unemployment gap by design

I'll do the same thing now, but reverse the direction. First I'll figure the HP trends for unemployment and GDP. Then I'll take the difference of GDP and its trend, shrink it by half -- that's the Okun's law part -- and add it to the unemployment trend, then use the result for my estimated unemployment numbers. Now it's simple.

Graph #4

Holy crap! It's a really good match.

Okay, again: Take the discrepancy between RGDP and its HP trend, shrink it by half per Okun's law, and add it to the unemployment HP trend. That's the red line. The blue line is FRED's UNRATE.

What I've learned:
1. The HP trend calc is a really good trend calc.
2. Laurence Ball's "output gap" is the difference between RGDP and its trend, without regard for inflation or the Phillips curve which play a role in the CBO calc. Ball's output gap is based on the trend of realized RGDP, not on Potential Output. This is a significant difference, but I now think not relevant to Ball's Econbrowser post.
3. Laurence Ball's calc is *not* circular, and it *is* interesting.

On Graph #4, the blue line is above the red line when actual unemployment is higher than the estimate. The blue line is lower when actual unemployment is lower than the estimate.

We like low unemployment. We like the blue line low.

Looking at Graph #4, I see two periods where the blue line is clearly below the red line for more than a very brief period. Those periods are 1960-1964 approximately, and 1994-2000 approximately. Those were both periods of exceptionally good economic growth, so we should expect the unemployment to be relatively low in those times. We should expect the blue line to be relatively low in those times.

I decided to look at the discrepancy between the two lines. I subtracted the blue line from the red. This gives me the "error" of the unemployment estimate, relative to realized unemployment.

Graph #5
For the most part, the error is within plus or minus half a percentage point. Not bad.


The Excel file containing my graphs and calcs is available for download from Google Drive.

Note that the file contains Kurt Annen's Hodrick-Prescott filter in Visual Basic code, and also some routines I use for formatting my graphs. If your security settings are reasonable, when you open the file Excel will warn you of a potential problem because the file contains VB code.

Excel doesn't know there's a problem. It only knows there could be a problem.

Excel lets you disable the code and open the file. But with the code disabled, the H-P filter calcs won't work and the whole thing will probably be garbage. So maybe you don't care to mess with it. But anyway, the file is available if you want.

No comments: