[R] mgcv, gam
Simon Wood
simon at stats.gla.ac.uk
Fri Jan 31 11:41:03 CET 2003
> I have some problems with gam in mgcv. Firts a detail: it would
> be nice igf gam would accept an na.action argument, but that not the
> main point.
- I find it hard to think of a sensible action except dropping the
associated data, but if you've a concrete suggestion I'm happy to add it
to the "to do" list.
> I want to have a smooth term for time over a year, the same pattern
> repeating in succesive years. It would be natural then to impose
> the condition s(0)=s(12). Is this possible within mgcv?
- It's possible, but not entirely straightforward - you could impose the
constraint using the pcls() routine, but it means digging around inside
the code a bit - see the ?pcls examples to get an idea of the sort of
thing required.
- It's probably worth checking out whether gss can do this more simply for
you.
> I tried to obtain this with trigonometric terms, aca:
>
> > Rot.gam2 <- gam(cbind(Rotavirus,Total)~ s( I(sin((MesN/12)*2*pi)),
> bs="cr" )+
> + s( I(cos((MesN/12)*2*pi)), bs="cr" ),
> data=na.omit(Rot),
> + family=binomial)
> Warning messages:
> 1: Termwise estimate degrees of freedom are unreliable
>
The problem here is basically that you have " a smooth function of a
smooth function of MesN " and " a smooth function of another smooth
function of MesN ", i.e. two smooth functions of MesN and hence some
identifiability problems. The error message reflects the numerical
difficulties resulting from these problems (which also explain the
lack of confidence intervals).
best,
Simon
_____________________________________________________________________
> Simon Wood simon at stats.gla.ac.uk www.ruwpa.st-and.ac.uk/simon.html
>> Department of Statistics, University of Glasgow, Glasgow, G12 8QQ
>>> Direct telephone: (0)141 330 4530 Fax: (0)141 330 4814
More information about the R-help
mailing list