Re: [R] smoothing splines and degrees of freedom

From: i.m.s.white <>
Date: Fri 30 Jun 2006 - 19:48:23 EST


I cannot vouch for the behaviour of the function smooth.spline(), but the theoretical answer to your question is yes. If g = Sy is the transformation from data vector y to spline vector g, the equivalent degrees of freedom are usually defined as EDF = trace(S), where S is the n x n smoothing matrix:

EDF = sum_i(1/(1+theta*lambda_i)),

where lambda_1 to lambda_n are the eigenvalues of S. Two of these are zero, so

EDF = 2 + sum(1/(1+theta*lambda_i))

the sum now over i=3 to n. Here theta is the smoothing parameter. Setting theta = 0 (no smoothing) gives EDF=n and produces the interpolating spline. Setting theta = infty gives EDF=2 and a straight line fit. See either

Green and Silverman, Nonparametric regression and generalized linear models, (p37), or
Hastie and Tibshirani, Generalized additive models, p52.

On Sat, Jun 24, 2006 at 11:35:16AM -0400, Steven Shechter wrote:
> Hi,
> If I set df=2 in my smooth.spline function, is that equivalent to running
> a linear regression through my data? It appears that df=# of data points
> gives the interpolating spline and that df = 2 gives the linear
> regression, but I just want to confirm this.
> Thank you,
> Steven
> ______________________________________________
> mailing list
> PLEASE do read the posting guide!

*    I.White                                   *
*    University of Edinburgh                   *
*    Ashworth Laboratories, West Mains Road    *
*    Edinburgh EH9 3JT                         *
*    Fax: 0131 650 6564   Tel: 0131 650 5490   *
*    E-mail:              *

______________________________________________ mailing list
PLEASE do read the posting guide!
Received on Fri Jun 30 20:59:10 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Fri 30 Jun 2006 - 22:14:04 EST.

Mailing list information is available at Please read the posting guide before posting to the list.