filter_hamilton: Hamilton Filter

Description Usage Arguments Value Examples

View source: R/07-filter.R

Description

Maturing lifecycle

This function computes the cyclical component of the Hamilton filter.

Usage

1
filter_hamilton(x, p = 4, horizon = 8, fill = NA)

Arguments

x

[univariate vector]

Univariate vector, numeric or ts object with only one dimension.

p

[integer(1): 4]

A value indicating the number of lags

horizon

[integer(1): 8]

A value indicating the number of periods to look ahead.

fill

[numeric or function: NA]

Numeric value(s) or function used to fill observations.

Value

Returns a vector with the same class and attributes as the input vector.

Examples

1
2
3
unemp <- ggplot2::economics$unemploy
unemp_cycle <- filter_hamilton(unemp)
plotx(cbind(unemp, unemp_cycle))

kvasilopoulos/transx documentation built on Jan. 26, 2021, 6:14 p.m.