print.bHP: Print method for class 'bHP'

View source: R/print.bHP.R

print.bHPR Documentation

Print method for class 'bHP'

Description

table of the bHP, in text (ASCII text output), latex (LaTeX code) or html (HTML/CSS code).

Usage

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

an object of class 'bHP'

type

a character string that specifies what style of print. Default choose is "bHP" showing designed table of class 'bHP'; choose "generic default" if you want to show the result of generic function plot.

trend_hist

logical; if TRUE, adding trend component after each HP-filter conduction into the table and call 'select_trend_hist' to choose which iteration; if FALSE, don't add trend component history to the table.

select_trend_hist

a numeric vector choosing which iteration time to show in the trend component history. It is valid only when 'trend_hist' is TRUE.

Head

logical; if TRUE, showing the head of the table; if FALSE and 'Tail' is TRUE, showing the tail of the table; if FALSE and 'Tail' is FALSE, showing the full-length of the table.

Tail

logical; if TRUE, showing the tail of the table; if FALSE and 'Head' is TRUE, showing the head of the table; if FALSE and 'Head' is FALSE, showing the full-length of the table.

print_type

a character vector that specifies what type of output the command should produce. The possible values are "text" (default) for ASCII text output, "latex" for LaTeX code, "html" for HTML/CSS code.

digit

controls the number of significant digits to print when printing numeric values. It is a suggestion only. Valid values are 1...22 with default 8. See the note in 'print.default' about values greater than 15.

Value

Table showing the content of bHP, "text" (default) for ASCII text output, "latex" for LaTeX code, "html" for HTML/CSS code.

Examples

lam <- 100 # tuning parameter for the annual data

data(IRE) # load the data 'IRE'

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

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

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

# by nonstop test type
# Iterated HP filter until Max_Iter and keep the path of BIC.

bx_nonstop <- BoostedHP(IRE, lambda = lam, iter= TRUE, stopping = "nonstop")
## Not run: 
#--------- start to print the content of bHP -----------------
print(bx_ADF)

print(bx_ADF, Head = F, Tail = T, trend_hist = F)

print(bx_ADF, Head = T, Tail = T, trend_hist = F)

print(bx_ADF, Head = F, Tail = F, trend_hist = F)

print(bx_BIC, Head = F, Tail = F, trend_hist = T, select_trend_hist = 1:bx_BIC$iter_num)

print(bx_BIC, Head = F, Tail = F, trend_hist = T,  select_trend_hist = c(1,3,5))

# when the trend_hist is FALSE, select_trend_hist is invalid
print(bx_BIC, Head = F, Tail = F, trend_hist = F, select_trend_hist = c(1,3,5))

print(bx_BIC, Head = F, Tail = T, trend_hist = F, print_type = "latex")

print(bx_BIC, Head = F, Tail = T, trend_hist = F, print_type = "html")

# show the generic print function output
print(bx_ADF, type = "generic default")

## End(Not run)

chenyang45/BoostedHP documentation built on Nov. 12, 2022, 11:36 a.m.