This function will fit a smoothing spline.
Fitting wit a specific lambda
We can specify df rather than <math>\lambda</math> .
smooth.spline(x, y, df = 10)
It's like a polynomial of degree 10. It has about that complexity, but it's smoother. So the degrees of freedom are not all spent on 10 polynomial terms, rather spread out over the whole spectrum of the function, from smooth to rough.
The LOOC Cross validation is done automatically in the function smooth.spline if you don't specify lambda or the degrees of freedom.