**Have a Question?**

**Phone:** +1 (888) 427-9486

+1 (312) 257-3777

Contact Us

# NxBK

Computes trend and cyclical component of a macroeconomic time series using Baxter-King Fixed Length Symmetric Filter.

## Syntax

**NxBK**(

**X**,

**Order**,

**P**,

**Q**,

**K**,

**Drift**,

**Unit-Root**,

**RetType**)

**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) |

**P**

is the number of periods for the high pass filter (e.g. 6 for quarterly data, 18 for monthly data).

**Q**

is the number of periods for the low-pass filter (e.g. 32 for quarterly data, 96 for monthly data).

**K**

is the number of points to use in the approximate optimal filter. If missing, a default value of 12 is assumed

**Drift**

is a logical value: FALSE if no drift in time series (default), TRUE if drift in time series.

**Unit-Root**

is a logical value: FALSE if no unit-root is in time series (default), TRUE if unit-root is in time series.

**RetType**

is the integer enumeration for the filter output: (1= trend component (default), 2=cyclical component, 3=noise component)

## Remarks

- The time series is homogeneous or equally spaced.
- The time series may include missing values (e.g. #N/A) at either end.
- The first and last K data points will not be filtered, hence replaced by #N/A in the output time series as their values are not reliable
- The recommended values of P and Q are 6 and 32 or 40 for quarterly data, or 18 and 96 or 120 for monthly data.
- Setting Q=P produces a single band-pass filer and the cyclic component will be 0.
- The noise component is simply the original data minus the trend and cyclic component
- Proper seasonal adjustment should be carried out prior to BK filtering.

## Examples

## References

- Marianne Baxter, Robert G. King (1999). "Measuring Business Cycles: Approximate Band-Pass Filters for Economic Time Series". The Review of Economics and Statistics 81 (4): 575â€“593.
- Hodrick, R., Prescott, E. (1997): "Postwar U.S. Business Cycles: An Empirical Investigation", Journal of Money, Credit, and Banking, 29(1), pp. 1-16.
- 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. 151-174