hp_weights() gives the matrix \(\mathbf{B}\) of the trend \(\hat{\mathbf{g}} =
\mathbf{B}\mathbf{x}\): row \(t\) holds the weights of the estimate at time \(t\). Symmetric in
the middle of the series, the rows become asymmetric near the ends, the source of the end-point bias (Hanif et
al. 2017, Figures 1 and 1a).
Arguments
- x
the length \(T\) of a series, or a result of
hp_filter(),mhp_filter()orfmhp_filter()(withas_dt = FALSE).- lambda
a smoothing parameter, or one per observation (
form = "rows") or per second difference (form = "differences"); ignored for a result.- form
"rows"(default) or"differences"; seefmhp_filter().- rows
the rows drawn by
plot()(default: the first, third, two middle and last two odd ones, as in the paper's figures).
Value
An object of class c("mhp_weights", "mhp_result", "list"): weights (the
\(T \times T\) matrix), lambda_t, form, rows. plot() draws the chosen rows.
Author
Muhammad Yaseen (myaseen208@gmail.com)
