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

Description Usage Arguments Value Examples

View source: R/plot.bHP.R

Description

all in one function of iterated HP-filter

Usage

1
2
3
4
5
6
7
8
## S3 method for class 'bHP'
plot(x, plot_type = "dynamic", interval_t = 0.3,
  ylab = "", col_raw = "#2D5375", col_trend_h = "#FBB545",
  col_trend_f = "red", col_pvalue_BIC = "red", raw_alpha = 255,
  trend_h_alpha = 75, trend_f_alpha = 255, pvalue_BIC_alpha = 255,
  legend_location = "upleft", iteration_location = "downright",
  cex_text = 1.7, cex_legend = 1.5, main = paste0("Figure of ",
  x$test_type, " bHP (", plot_type, ")"))

Arguments

x

the data you want to conduct HP-filter

lambda

the turning parameter

iter

logical parameter, TRUE is to conduct iterated HP-filter, FALSE is not

test_type

the type for creterion

sig_p

significant p-value

Max_Iter

maximum iterated time

Value

cycle component, iterated number, p-value .

Examples

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

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

# 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)

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