Andrew Crane-Droesch
2015-Jun-18 02:23 UTC
[R] Is there a convenient way of extracting the matrix `solve(X %*% t(X) + PENALTY)` from an additive model fit in mgcv?
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