print.bHP: all in one function of iterated HP-filter

Description Usage Arguments Value Examples

View source: R/print.bHP.R

Description

all in one function of iterated HP-filter

Usage

1
2
3
4
## S3 method for class 'bHP'
print(x, type = "bHP", trend_hist = TRUE,
  select_trend_hist = c(1), Head = FALSE, Tail = FALSE,
  print_type = "text", digit = 8)

Arguments

x

the data you want to conduct HP-filter

Value

cycle component, iterated number, p-value .

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
lam <- 100 # tuning parameter for the annaul data

# raw HP filter
bx_HP <- BoostedHP(x, lambda = lam, iter= FALSE)$trend

# by BIC
bx_BIC <- BoostedHP(IRE, lambda = lam, iter= TRUE, test_type = "BIC")

# by ADF
bx_ADF <- BoostedHP(IRE, lambda = lam, iter= TRUE, test_type = "adf", sig_p = 0.050)

# summarize the outcome
outcome <- cbind(IRE, bx_HP$trend, bx_BIC$trend, bx_ADF$trend)

matplot(outcome, type = "l", ylab = "", lwd = rep(2,4))

lyig123/test2 documentation built on Nov. 4, 2019, 5:16 p.m.