filter_boosted_hp: Boosted HP filter

Description Usage Arguments Value Source References Examples

View source: R/07-filter.R

Description

Experimental lifecycle

This function computes the cyclical component of the Boosted Hodrick-Prescot filter.

Usage

1
2
3
4
5
6
7
filter_boosted_hp(
  x,
  lambda = 1600,
  stopping = "nonstop",
  sig_p = 0.05,
  max_iter = 100
)

Arguments

x

[univariate vector]

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

lambda

[numeric(1): 1600]

Smoothness penalty parameter.

stopping:

[character: "nonstop"]

  • If stopping = "adf" or "BIC", used stopping criteria.

  • If stopping = "nonstop", iterated until max_iter

sig_p:

[numeric(1): 0.05]

The significance level of the ADF test as the stopping criterion. It is used only when stopping == "adf".

max_iter:

[numeric(1): 100]

The maximum number of iterations.

Value

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

Source

This function has been retrieved and rewritten from https://github.com/zhentaoshi/Boosted_HP_filter/blob/master/R/BoostedHP.R

References

Phillips, P.C.B. and Shi, Z. (2021), BOOSTING: WHY YOU CAN USE THE HP FILTER. International Economic Review. https://doi.org/10.1111/iere.12495

Examples

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

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