Yes... ## example fit... library(mgcv) set.seed(2) ## simulate some data... dat <- gamSim(1,n=400,dist="normal",scale=2) b <- gam(y~s(x0)+s(x1)+s(x2)+s(x3),data=dat) ## extract the thing required in the title.... b$Vp/b$sig2
best, Simon On 18/06/15 03:23, Andrew Crane-Droesch wrote:
The title says it all. An additive model can be fit by `solve(X %*% t(X) + PENALTY)%*%t(X)%*%y` (though of course there are more efficient ways to do it). I want the matrix `solve(X %*% t(X) + PENALTY)` from a fitted gam object. GAM objects can be a bit tricky to navigate -- is there a convenient way of extracting this? Happy to explain why I'm interested in this to anyone who would like to know, off-list. Many thanks! Andrew ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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.
-- Simon Wood, Mathematical Science, University of Bath BA2 7AY UK +44 (0)1225 386603 http://people.bath.ac.uk/sw283 ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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.