Page 1 of 1

De-trending

Posted: Thu May 21, 2009 7:18 am
by Nils
How do I de-trend a time series in Eviews? The variable POPULATION is trend-stationary with 4 lags. The trend component is 4.40E-06. Deleting 4.40E-06*@trend from POPULATION does not seem to do the trick as the new variable (POPULATION-4.40E-06*@trend) is not stationary. Does anyone have an idea?

Re: De-trending

Posted: Thu May 21, 2009 7:40 am
by trubador
You can also try polynomial specifications (e.g. @trend^2, @trend^3, etc.). However, your data may have a stochastic trend other than a deterministic one. In that case, one remedy would be to extract the trend from your series with HP-filter. For annual series:

Code: Select all

series.hpf(lambda=100) trend

Re: De-trending

Posted: Thu May 21, 2009 8:19 am
by startz
How do I de-trend a time series in Eviews? The variable POPULATION is trend-stationary with 4 lags. The trend component is 4.40E-06. Deleting 4.40E-06*@trend from POPULATION does not seem to do the trick as the new variable (POPULATION-4.40E-06*@trend) is not stationary. Does anyone have an idea?
Regress population on @trend and lags and save the residuals as the detrended series.

Re: De-trending

Posted: Thu Jun 04, 2009 5:10 am
by w2quesang
hi! for the Hodrick-Prescott filter, may I know what is the multiplier Lamda for daily and weekly data series? thanks : )

Re: De-trending

Posted: Thu Jun 04, 2009 7:46 am
by trubador
Rule of thumb is:
Lambda = 100*(number of periods in a year)^2

In this respect, for:
Annual data = 100*1^2 = 100
Quarterly data = 100*4^2 = 1,600
Monthly data = 100*12^2 = 14,400
Weekly data = 100*52^2 = 270,400

I think you have got the idea...

Re: De-trending

Posted: Tue Jul 31, 2012 7:36 am
by drewtedlock
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

Harvey and Trimbur (2008) explain the risk in using a too-small smoothing parameter (lambda), though I have yet to find research explaining the risk of using too-large of a smooth parameter, other than the trend becomes increasingly linear and less sensitive to recent data. http://www.terrapub.co.jp/journals/jjss ... 010041.pdf

I struggle to understand how to determine the ideal window-length, however. If I understand correctly, the HP filter uses default cut-off values of 18-96. However, research suggests using a wider window of 12-120 months (see the OECD Methodology for Cycle Extraction). It is unclear to me how to change this in EViews, at least using the menu commands (I'm afraid I'm not terribly experienced in using code). Any suggestions?

Additionally, some of the literature references the double HP filter in which a large and then small value of lambda are used (to detrend and then smooth, respectively). Yet, there are no references to what a reasonably large or small value of lambda might be - no rule of thumb, if you will. Any advice on this topic would also be appreciated.

Regards,
Drew

Re: De-trending

Posted: Tue Jul 31, 2012 11:49 pm
by trubador
Arbitrariness of lambda (or the smoothness) parameter is one of many drawbacks of HP filter. EViews has other built-in frequency filters (i.e. Baxter-King, Christiano-Fitzgerald), where you can control the cycle periods. Details are in the manual, but you can always ask for help if you have any trouble using them. In addition to these, I also recommend you the FDFilter add-in developed by Corbae-Ouliaris, which calculates the Frequency Domain (FD) approximation to the ideal band pass filter.

Please note that you need to be using the latest version of EViews 7.1 to use the add-in.

Re: De-trending

Posted: Mon Aug 06, 2012 12:18 pm
by drewtedlock
Thanks for the excellent suggestion, Trubador! The Frequency-Domain (FD) filter by Corbae and Ouliaris seems to perform much better than an HP/BK/CF filter, all of which suffer from end-point problems. However, I'm still having some issues using the FD filter. Is there a good users’ guide I am somehow overlooking?

1) Does the FD filter automatically detect and use the periodicity of the workfile? I know this is the case for other band pass filters in EViews, but when using the FD filter in monthly and quarterly settings, the default cycle periods are the same which makes me think it must be manually adjusted to fit the data at hand.
2) Similarly, how does one calculate the cycle periods? Is it simply 2 divided by the number of periods? The default values for quarterly data are .333 (2/6 quarters) and .0625 (2/36 quarters).
3) The HP filter requires seasonally adjusted data series. Is this also the case with the FD filter?

Other interested readers may appreciate an empirical application of the FD filter in a business cycle/forecasting scenario. This easy-to-read and instructional paper comes from the Monetary Authority of Singapore: http://www.mas.gov.sg/en/Monetary-Polic ... _SF_A.ashx

Best regards,
Drew

Re: De-trending

Posted: Mon Aug 06, 2012 12:26 pm
by EViews Gareth
As with all add-ins, you can view the documentation associated with it by clicking on the "Docs" button of the Manage Add-ins dialog.

Re: De-trending

Posted: Mon Aug 06, 2012 12:40 pm
by drewtedlock
I was unaware of this documentation. Thank you, Gareth. While that answers my first and second questions, it is still unclear if the series must be seasonally adjusted before applying the Corbae-Ouliaris FD filter.

Re: De-trending

Posted: Tue Aug 07, 2012 12:15 am
by trubador
Since the filter focuses on extracting the cyclical component, I'd suggest you to seasonally adjust your series first.

Re: De-trending

Posted: Wed Aug 15, 2012 2:20 pm
by drewtedlock
That was my instinct as well. Thank you, trubador!

A brief update for fellow users interested in the HP filter:
I'm still investigating the proper procedures for detrending using either the HP or Corbae-Ouliaris FD filter with the ultimate goal of a side-by-side comparison of their empirical accuracy in forecasting applications. While the FD filter makes it easy to set a "window" for the cycle-lengths of interest, it was unclear how to apply the HP filter with such an equivalent window. After some more searching I found the OECD offers an alternative guideline for choosing the smoothing parameter (lambda), which allows users to approximate a window:

"In the OECD CLI methodology, the default settings allow to [sic] remove cyclical components that have a cycle length longer than 120 month and those that have a cycle length shorter than 12 months. They are equivalent of setting λ = 133107.94 and λ = 13.93 respectively.

Going from frequencies to λ parameter is achieved by substituting into the formula:

λ=[4(1-cos(ω0))2]-1.

Whereas ω0 is the frequency expressed in radians, and τ denotes the number of periods it takes to complete a full cycle. The two parameters are related through ω0=2π/τ. So the λ values above correspond to τ=120 months and τ=12 months."
See here: http://www.oecd.org/fr/std/indicateursa ... aqs.htm#12

OECD literature (http://stats.oecd.org/mei/default.asp?lang=e&subject=5) suggests first detrending and then smoothing (using the larger and then smaller smoothing parameter, respectively). After the first application of the HP filter (detrending, larger parameter), one is left with a cyclical and a trend component. The original series is detrended by dividing the original series by this trend component, thus implying a multiplicative approach. Multiplicative methods seem toto be the most popular and the Bank of Spain explains why in its TRAMO/SEATS literature, which has lots of useful information regarding additive versus multiplicate approaches: "Usually, the decomposition scheme is
multiplicative (either pure multiplicative or log-additive), because in most economic time series, the magnitudes
of the seasonal component appear to vary proportionally to the level of the series" (http://epp.eurostat.ec.europa.eu/cache/ ... 006-EN.PDF). This detrended ratio-to-trend series is used in the second application of the HP filter (smoothing, smaller paramter) and one is left with a smoothed, detrended ratio-to-trend series. This series fluctuates around 1, making the retrending stage easy: multiply the trend of the reference series by the standardized/averaged set of leading indicator components. Don't forget to rescale first - the amplitudes of these detrended ratio-to-trend leading indicator compnents must be adjusted to match the original reference series' ratio-to-trend.

I was unable to find an explanation of the additive approach (typically after a log-transformation), which seems trickier in that the 'true' mean of the cyclical compenents is unclear. How do you add the cyclical component to the trend component if their means have been changed in the aggregation and data manipulation steps? Any comments and critiques are very welcome!

Regards,
Drew

Re: De-trending

Posted: Wed Aug 29, 2012 9:11 am
by drewtedlock
I found a helpful Excel add-in for the Hodrick-Prescott (HP) filter here: http://www.web-reg.de/hp_addin.html I'm not comfortable with coding in EViews, so that was a better fit for my needs and I thought others might similarly benefit.

As far as I can tell, the FD filter is only available as an Excel Add-In from DBank: http://www.tsdbank.com/features/dbexcel/statarray.html Free 30 day trial, $500 to purchase thereafter.