How Economists Convert Quarterly Data into Monthly: Cubic Spline Interpolation

Só repassando esse achado que fiz procurando um método de mensalização (dados trimestrais para mensais) aqui na empresa. Usem com cuidado!

Columbia Economics, L.L.C.

(Update: Please note that cubic spline interpolation can only provide estimates of data between known data points. It cannot “create” unknown data. For example, if only annual figures exist for your data set, then annual observations are the only real data. Cubic splining between them to generate monthly estimates is only an approximation technique, and does not provide new actual monthly figures). For this reason, the below method may not be appropriate for all research purposes.)

A common problem economists face with time-series data is getting them into the right time interval. Some data are daily or weekly, while others are in monthly, quarterly or annual intervals. Since most regression models require consistent time intervals, an econometrician’s first job is usually getting data into the same frequency.

In this post I’ll explain how to solve a common problem we’ve run into: how to divide quarterly data into…

Ver o post original 994 mais palavras

Filtro de Hodrick-Prescott no Excel

Um pouco fora da minha área certamente mas estou sempre pronto a apreciar boa programação e facilidade de uso. Se você precisa tirar a tendência de uma série com o filtro HP e quer a facilidade do Excel, ou quer usar em um ambiente de trabalho onde os programas são controlados, fica a dica do site abaixo. Ele explica onde baixar o add-in e como utilizar. Testado e aprovado.

There is a how to use PDF, short, says you give it a range of cells and a number (a constant). The long version: Select a range of cells for your results, type =HP( , select the range of cells containing the data to be filtered, type in a comma, type in the constant, and close the parentheses. But don’t hit ENTER.

Instead, hold down CTRL and SHIFT and then press ENTER. That’s it. Then you can make a graph or whatever, from the results.

Holding down CTRL and SHIFT while you press ENTER is standard Excel stuff. They call it “array formulas” which sounds pretty complicated… but all you have to do is hold down CTRL and SHIFT while pressing ENTER. How complicated is that?

None of that works, though, if you don’t have the Hodrick Prescott filter installed. No problem. Among the search results is a link to Kurt Annen’s HP-Filter Excel Add-In at IDEAS. There are three separate files you can download:

1. an XLA file, an Excel add-in which adds the HP( ) function to the built-in Excel functions.

2. the Visual BASIC source code for the HP( ) function.

3. an example.

For most people the simple thing would be to install the add-in. (The PDF linked above tells how.) For me, the simple thing was to copy the Visual BASIC source code and paste it into a code module. That way I got to look the code over a bit. It looks like a very complicated (arithmetically) version of a “moving average” calculation, or something comparable. That’s a crude description; I didn’t work through all the arithmetic. But the result you get from the HP filter serves the same sort of purpose as the result you get from the moving average calc.

Anyway, after it’s installed one way or the other, it’s as easy to use as =SUM( ) or any other Excel function. I expect to explore it, and to use it.

What number do you use for the constant?… for the “Lambda” as they call it?

Rule of thumb is:

Lambda = 100*(number of periods in a year)^2

There is additional research that suggests using a power of 4 instead of 2. See Ravn and Uhlig (2002). http://ideas.repec.org/a/tpr/restat/v84 … 1-375.html

via The New Arthurian Economics: De-Trending.