[R] package mgcv

Simon Wood s.wood at bath.ac.uk
Mon Jun 9 11:36:19 CEST 2008


The coefficients of the splines are in the `coefficients' part of the fitted 
`gam' object, but what they mean depends on what basis you used.... Chapter 4 
of Wood S.N. (2006) Generalized Additive Models: An Introduction with R. 
Chapman and Hall/CRC Press, gives the details for all the built in smoothers. 
Otherwise it's a matter of looking at the `Predict.matrix.*' functions for 
the smooth, but that in turn may mean digging in to the mgcv source code. 

It is possible to extract the functional forms, but it is also tedious, 
largely becuase `mgcv' mostly uses smoothers with nice optimality properties, 
but these often have rather complicated bases. If you want a simple easy to 
write down basis then you could try using the example smooth class given 
in ?smooth.construct in mgcv 1.4. These smoothers are very easy to write 
down, but their performance is usually not as good as the built in bases....

Why do you need the actual bases? (Sometimes when people ask this question 
there is a simpler way of accessing the thing that is actually needed...)


On Monday 09 June 2008 10:12, Amandine PIERROT wrote:
> Hello ! I am working on generalized additive models using the package mgcv,
> and I would like to know where I could find information about the estimated
> splines so I could reconstruct the full function instead of just having
> values at given points (with predict.gam, type="terms") ? Thanks in
> advance, Amandine.
> _________________________________________________________________
> Votre contact a choisi Hotmail, l'e-mail ultra sécurisé. Créez un compte
> gratuitement !
> 	[[alternative HTML version deleted]]

> Simon Wood, Mathematical Sciences, University of Bath, Bath, BA2 7AY UK
> +44 1225 386603  www.maths.bath.ac.uk/~sw283 

More information about the R-help mailing list