[R] gamm(): degrees of freedom of the fit

Fabian Scheipl f.abian at gmx.net
Wed Nov 1 21:51:36 CET 2006


I wonder whether any of you know of an efficient way to calculate the approximate degrees of freedom of a gamm() fit.

Calculating the smoother/projection matrix S: y -> \hat y and then its trace by sum(eigen(S))$values is what I've been doing so far- but I was hoping there might be a more efficient way than doing the spectral decomposition of an NxN-matrix.

The degrees of freedom associated with the linear and smooth parts can be read from the gam-part of the fitted gamm()-model, but not the degrees of freedom associated with the random effects. For lmer()-models, there is hatTrace() but I know of nothing of the sort for lme()-Objects.

Maybe somebody has some code or ideas to share?



--



More information about the R-help mailing list