Have a Question?
Phone: +1 (888) 4279486
+1 (312) 2573777
Contact Us
NxHP
computes cyclical component of a given time series using the HodrickPrescott filter.
Syntax
NxHP(X, Order, Lambda, Freq)
X
is the univariate time series data (a one dimensional array of cells (e.g. rows or columns)).
Order
is the time order in the data series (i.e. the first data point's corresponding date (earliest date=1 (default), latest date=0)).
Order  Description 

1  ascending (the first data point corresponds to the earliest date) (default) 
0  descending (the first data point corresponds to the latest date) 
Lambda
is the HodrickPrescott filter smoothing parameter (a positive multiplier).
Freq
is the frequency of the input time series ( 1= quarterly (default), 2 = annual, 3= monthly).
Remarks
 The time series is homogeneous or equally spaced.
 The time series may include missing values (e.g. #N/A) at either end.
 The HodrickPrescott filter is used to obtain a smoothedcurve representation of a time series, one that is more sensitive to longterm than to shortterm fluctuations

In sum, The HodrickPrescott filter is a mathematical tool used to separate the cyclical component of a time series from raw data:
Where:
 .
 is the input time series.
 is the cyclical component.
 is the trend component.
 Hodrick and Prescott (1997) suggest the following criterion to reveal the unobserved components, and , conditional on a choice of "smoothing parameter" :
 An expert judgment for the choice of is necessary. In general, the close is to zero, the closer is filtered trend to the original series. Likewise, if approaches infinity, the filtered trend becomes a straight line.
 If lambda is zero or negative, NxHP return #VALUE!
 If lambda is is missing, and frequency value is given, lambda is set to: 1600 (quarterly data), 6.25 (annual data) or 129600 (monthly data).
 In the event that lambda and data frequency are missing, lambda ise set to a default value of 1600.
 The input data must be properly seasonal adjusted prior to HP filtering.
 HP Analysis is purely historical and static (closed domain). The filter causes misleading predictions when used dynamically since the algorithm changes (during iteration for minimization) the past state (unlike a moving average) of the time series to adjust for the current state regardless of the size of \lambda used.
 In comparison to other techniques, such as the production function approach or the Kalman filter, the HP filter forms a fast and easy to use alternative.
Files Examples
References
 Hodrick, R., Prescott, E. (1997): "Postwar U.S. Business Cycles: An Empirical Investigation", Journal of Money, Credit, and Banking, 29(1), pp. 116.
 Beveridge, S., Nelson, C. R. (1981): "A New Approach to Decomposition of Economic Time Series into Permanent and Transitory Components with Particular Attention to Measurement of the Business Cycle", Journal of Monetary Economics, No. 7, pp. 151174
 Hamilton, J .D.; Time Series Analysis , Princeton University Press (1994), ISBN 0691042896
 Tsay, Ruey S.; Analysis of Financial Time Series John Wiley & SONS. (2005), ISBN 0471690740