Extract the optimal smoothing parameter lambda from Modified HP filter results.
Arguments
- x
Result from
mhp_filter(either data.table or mhp object).
Examples
set.seed(123)
result <- mhp_filter(cumsum(rnorm(100)), max_lambda = 10000)
get_lambda(result)
#> [1] 562
# With mhp object
result_obj <- mhp_filter(cumsum(rnorm(100)), max_lambda = 10000, as_dt = FALSE)
get_lambda(result_obj)
#> [1] 896