get_lambda() returns the smoothing parameter and get_gcv() the value of McDermott's criterion of a
result of hp_filter(), mhp_filter() or fmhp_filter(), whether it is a
data.table (as_dt = TRUE) or a list (as_dt = FALSE).
Author
Muhammad Yaseen (myaseen208@gmail.com)
Examples
data(us_macro)
m <-
mhp_filter(
x = log(us_macro$gdp)
, max_lambda = 100000
, as_dt = TRUE
, log_scale = FALSE
, criterion = c("approximate", "exact")
)
get_lambda(x = m)
#> [1] 683
get_gcv(x = m)
#> [1] 0.0002819926