Skip to contents

Cubic smoothing spline fit (I + lambda K)^{-1} y with the Reinsch / Green-Silverman roughness penalty \(K = D' W^{-1} D\). The tridiagonal \(W\) is inverted – the un-inverted form \(D' W D\) agrees only at the two limits and is wrong at every intermediate lambda.

Usage

morie_esl_smoothing_spline(x, y, lambda)

Arguments

x

strictly increasing design points.

y

responses, same length as x.

lambda

non-negative smoothing penalty.

Value

list with estimate, effective_df, rss, lambda, n.

References

Hastie, Tibshirani and Friedman (2009). The Elements of Statistical Learning (2nd ed.), Sec. 5.4. Reinsch, C. (1967). Smoothing by spline functions. Numerische Mathematik, 10(3), 177-183.

Examples

morie_esl_smoothing_spline(x = c(1, 2, 3, 4, 5, 6, 7, 8), y = c(1, 2, 3, 4, 5, 6, 7, 8),
  lambda = 0.5)
#> $estimate
#> [1] 1 2 3 4 5 6 7 8
#> 
#> $effective_df
#> [1] 4.217365
#> 
#> $rss
#> [1] 6.705318e-30
#> 
#> $lambda
#> [1] 0.5
#> 
#> $n
#> [1] 8
#> 
#> $method
#> [1] "smoothing spline (I + lambda D'W^-1 D)^-1 y; df = tr(S)"
#>