Re: [R] package mgcv

From: Simon Wood <s.wood_at_bath.ac.uk>
Date: Mon, 09 Jun 2008 10:36:19 +0100

Amandine,

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...)

best,
Simon

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

______________________________________________ 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.

Received on Mon 09 Jun 2008 - 09:37:17 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 09 Jun 2008 - 10:30:39 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive