[R] Is there a convenient way of extracting the matrix `solve(X %*% t(X) + PENALTY)` from an additive model fit in mgcv?

Andrew Crane-Droesch andrewcd at berkeley.edu
Thu Jun 18 04:23:18 CEST 2015


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



More information about the R-help mailing list