[R] mgcv

Simon Wood snw at mcs.st-and.ac.uk
Thu Jul 26 11:32:35 CEST 2001

> may you send me the exact syntax for getting the estimated degrees
> of freedom for a gam?
> I tried to do it by
>  name <- edf(gam_name)
> but this didn't work.
- sorry I've not (yet) written a function to extract this so you'll have
to use:

> gam_name$edf 

which will yield an array of estimated degrees of freedom for each smooth
term in the model. To get the total edf you'll need to sum this array and
add on the d.f.s for any parameteric model terms (e.g. the 
constant). Total edf is also printed by print.gam(). e.g.

> gam_name

Family: gaussian 
Link function: identity 

y ~ s(x0) + s(x1) + s(x2) + s(x3)

Estimated degrees of freedom:
 2.745596 3.172674 6.976935 1.537905   total =  15.43311 

GCV score:  4.252583 


> Simon Wood  snw at st-and.ac.uk  http://www.ruwpa.st-and.ac.uk/simon.html
> The Mathematical Institute, North Haugh, St. Andrews, Fife KY16 9SS UK
> Direct telephone: (0)1334 463799          Indirect fax: (0)1334 463748 

r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch

More information about the R-help mailing list