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?



--

______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to