Showing posts with label FRED. Show all posts
Showing posts with label FRED. Show all posts

Sunday, April 14, 2013

Average it is, then


How does FRED think? When you take a time series that's given in "quarterly" values and you change the aggregation to "annual" values, how does that work exactly?

In particular, I'm thinking of the GDP Deflator. You know: the one where the 2005 value is 100, making it easy to compare prices of other years.

GDPDEF, FRED's GDP Deflator, defaults to quarterly values. So, which of the four quarters of 2005 has the value 100??? None of them, as it turns out:

Graph #1
Second quarter is a little low, third quarter is a little high. First and fourth are worse. I figured as much. It's gotta be the annual numbers that will turn up the special value that has to be there.

But when you look at FRED's GDPDEF page and change the aggregation from quarterly to annual, an option field appears asking whether you want average, sum, or end of period aggregation. Three ways to turn the four quarterly values into the value 100. Which method will work?

I was pretty sure that "sum" would take the four values from 2005 -- all of them in the neighborhood of 100 -- and add them together to give me a result in the neighborhood of 400. And yes, that is what happens. So the "sum" option is not the one.

We are left with two options: the average of the four values, or the last of the four. When you switch quarterly data to annual aggregation, FRED defaults to average aggregation. So I figured that one would give me the value 100. But just to be sure, I plotted the data both ways:

Graph #2: Aggregation by Average of Values (blue) and by Last of Values (red)
Click Graph for FRED Source Page
The second set of red and blue of bars, second from the left, shows the blue bar right there at 100.0, and the red bar higher. For me, this confirms that the well-known GDP Deflator value 100, at FRED at least, is the average of the quarterly values.

I downloaded the numbers, just to be sure. The value for 2005 is 99.993. Close enough for government work. Funny thing, though: It's off by double-o-seven.

Wednesday, April 10, 2013

Logging


I know two ways to make a "log" graph at FRED. You can "Apply a Transformation to the Formula Result", selecting the "Natural Log" option. Or you can modify the graph settings, and check a checkbox to make the vertical scale a log scale.

The first method changes the values of your data, and gives you regularly spaced numbers on the vertical scale.

The second method does not change the values of your data, but gives you irregularly spaced numbers on the vertical scale.

Each of the graphs below shows one data series two ways. The blue line uses the first method, where taking the natural log changes the values. The red line uses the second method, which keeps the original values but adjusts the vertical scale.

The blue line in each of the following examples is plotted on the left-hand scale, and the red line on the right scale:

Graph #1

Graph #2

Graph #3

Why, you may ask, do the graphs show different mismatches? For population the lines run parallel. For GDP, they cross in the middle. And for debt, they meet at the end.

Really, this is a matter of stretching or sliding one line a little more or less than the other. It has to do, I think, with the automated selection of "round numbers" for the vertical scale values. But despite these slight mismatches, you can see that the two methods of creating a log graph produce lines of similar shape.