[R] Basis functions of cubic regression spline in mgcv
sw283 at bath.ac.uk
sw283 at bath.ac.uk
Mon Sep 27 15:42:44 CEST 2010
The functional form is given in chapter 4 of my book:
Wood S.N. (2006) Generalized Additive Models: An Introduction with R.
Chapman and Hall/CRC Press. (reserve your copy now for christmas)
... but note that by default mgcv reparameterises so that the
identifiability constraints on the smooths are satisfied automatically
(also covered in chapter 4 of the same book).
You can get at the evaluated basis functions from the columns of the
result of predict.gam(...,type="lpmatrix") - see help files for
details. The penalty matrices are stored in the `smooth' list element
of the fitted `gam' object. For example x$smooth[[1]]$S[[1]].
best,
Simon
Quoting Yan Li <leemom.atlanta2009 at gmail.com>:
> I have a question about the basis functions of cubic regression spline in
> mgcv. Are there some ways I can get the exact forms of the basis functions
> and the penalty matrix that are used in mgcv? Thanks in advance!
>
> Yan
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org 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.
>
>
More information about the R-help
mailing list