powered by
This function computes the cyclical component of the Hamilton filter.
filter_hamilton(x, p = 4, horizon = 8, fill = NA)
[univariate vector]
Univariate vector, numeric or ts object with only one dimension.
[integer(1): 4]
A value indicating the number of lags
[integer(1): 8]
A value indicating the number of periods to look ahead.
[numeric or function: NA]
Numeric value(s) or function used to fill observations.
Returns a vector with the same class and attributes as the input vector.
# NOT RUN { unemp <- ggplot2::economics$unemploy unemp_cycle <- filter_hamilton(unemp) plotx(cbind(unemp, unemp_cycle)) # }
Run the code above in your browser using DataLab