Determining smoothing parameter in HP filter for hourly data I'm trying to determine a smoothing parameter for the Hodrick-Prescott filter. I've seen that there are papers on the topic but they are far too advanced for my comprehension. If I have a data set, $X$, what are the steps to take?
My data is hourly. Using MATLAB I know the smoothing parameter values for monthly data etc., but how can I compute it for hourly data?
 A: The equation you are looking for is
$$\lambda_\alpha = \frac{1}{\alpha^4}\lambda_1$$
which is the adjustment factor derived by Ravn and Uhlig (2002). They derived the smoothing factor for annual data with this formula using the $\lambda = 1600$ for monthly data which was originally suggested by Hodrick and Prescott. That is
$$\lambda_{\text{annual}} = \frac{1}{4^4}1600 = 6.25 $$
You can re-arrange the equation and then solve the optimal smoothing factor for any data frequency. You can get the monthly smoothing factor from
$$12^4 \cdot 6.25 = 129,600$$
where 12 is the data frequency in months. Now you just need to know how many hours there are in a year which, according to Google, is 8765.81 and then you just plug it in again to get some very large number:
$$8765.81^4 \cdot 6.25 = 36,901,857,672,400,771.793$$
I doubt though that this will get you far because the Hodrick Prescott filter was developed for aggregate macro data in order to study business cycles at a quarterly, annual or at most monthly frequency. The filter was not meant to be for hourly data and I cannot imagine that it will perform well for your kind of application. For instance, if you search on Google scholar for Hodrick-Prescott "hourly data" you will not find anything. So even though this should answer your question, I would still be vary of using this result.
