The trend solves the banded normal equations of the penalised least squares problem. lambda = 0 returns the series itself and lambda -> infinity returns the least-squares straight line; both limits are exact and are what the tests check.
References
Hodrick and Prescott (1997), Postwar U.S. business cycles: an empirical investigation, Journal of Money, Credit and Banking 29(1):1-16. doi:10.2307/2953682
Examples
V <- c(1, 2, 3, 4, 5, 6, 7, 8)
Hodprc(V)
#> $estimate
#> [1] 2.31949e-23
#>
#> $trend
#> [1] 1 2 3 4 5 6 7 8
#>
#> $cycle
#> [1] 2.107203e-12 1.989520e-12 1.870060e-12 1.746603e-12 1.617373e-12
#> [6] 1.483258e-12 1.345590e-12 1.205258e-12
#>
#> $cycle_ss
#> [1] 2.302545e-23
#>
#> $roughness
#> [1] 1.059046e-28
#>
#> $lam
#> [1] 1600
#>
#> $n
#> [1] 8
#>
#> $method
#> [1] "(I + lambda D'D) tau = y, Hodrick & Prescott (1997)"
#>
#> attr(,"class")
#> [1] "morie_rich_result" "list"
