How to remove trend with no look ahead bias? I would like to explore the different ways one can detrend a time series without look ahead bias.
I wanted to use the Hodrick Prescott filter, which seems like a quite good frequency filter, but it is based on an optimization method, and I understand that it may give strange and volatile results at the border.
Wavelet smoothing on a rolling window would be another option, but again border effects can be huge (the data is copied by symmetry which is horrible for the precision of the technic at the edge).
Any idea or comments?
PS: The subject has already been discussed here, I know. But I would like to dig a bit more on a more precise question.
 A: There is no way to get rid of the end effects.
Like any interpolation technique, the HP method depends on data before and after the current location to provide a filtered point/line for that location.   As you approach either end of the data series and drop below the required number of future (or past) points, you either don't provide the filtered line or the characteristics of the filtered line must change.
It is dangerous to blindly extend the line and assume that it has the same properties at the ends of the series as it does in the middle.   The bottom line is, the HP filter has no predicting power.
A: De-trending requires a pre-specification of of how many values do you require before declaring that a new trend has started. Given this specification , say n values then one has to be concerned with distinguishing between Level Shifts ( i.e. intercept changes ) and time trend changes. If you assume that there are no Level Shifts then simply search for different points in time and select those points which have been find to be statistically significant. For example if you have the series 1,2,3,4,5,7,9,11 ...this would suggest two points in time where the trend "changed" , period 1 and period 5. Alternatively if you have a series like 0,0,0,0,0,1,2,3,4,5,,,,,, there is only 1 point in time where a significant trend is evidenced i.e. period 5 . Outliers and ARIMA structure in a time series can lead to distortions in the identification of trend-point changes and may need to be incorporated prior to trend-point detection. A recent paper on tree-ring data http://www.autobox.com/pdfs/forestdisturbance.pdf discusses this issue.
A: One possibility would be to forecast/backcast both endpoints.
Many seasonal adjustment methods like X12-ARIMA and TRAMO-SEATS do that.
If you apply centered moving averages to the data, then you must somehow have more observations than series has. Some future and past values are needed.
Regards,
-A
