# R - Smoothing spline

## Function

This function will fit a smoothing spline.

smooth.spline


## Fitting wit a specific lambda

We can specify df rather than $\lambda$ .

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.

## Cross validation

The LOOC Cross validation is done automatically in the function smooth.spline if you don't specify lambda or the degrees of freedom.

smooth.spline(x, y)