Experimental lifecycle

filter_boosted_hp(
  x,
  lambda = 1600,
  iter = TRUE,
  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.

Source

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

Value

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

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

unemp <- ggplot2::economics$unemploy unemp_cycle <- filter_boosted_hp(unemp)
#> Error in filter_boosted_hp(unemp): could not find function "filter_boosted_hp"
plotx(cbind(unemp, unemp_cycle))
#> Error in cbind(unemp, unemp_cycle): object 'unemp_cycle' not found