[R] Almost a GAM?

Simon Wood snw at mcs.st-and.ac.uk
Tue Jan 29 10:39:37 CET 2002


> > > I would like to estimate, for lack of a better description,
> > > a partially additive non-parametric model with the following
> > > structure:
> > >
> > > z~ f(x,y):w1 + g(x,y):w2 + e
> > >
> > > In other words, I'd like to estimate the marginals with
> > > respect to w1 and w2 as nonparametric functions of
> > > x and y.
> 
> This model should be a "univariate version" to fit interaction between a
> variate, x and a factor w, say:
> z~ f(x, df1):w1 + g(x, df2):w2 + e
> To fit this model a possible solution is
> 
> 1)build the variate x in each level of w
> xw1<-x*w1
> xw2<-x*w2
> 
> 2)then fit gam, by:
> z~ w1+w2-1+f(xw1, df1)+ g(xw2, df2)
> 
> I am not able to find any theoretical difficulty in this model and
> furthermore it seems to work with gam().

- This often seems to work quite well, but the problem is that f(0) and
g(0) are not equal to zero - so it doesn't do exactly what you would like
*and* all those zero covariate values will influence the smoothing
parameter selection. [Of course if the model of interest is really this
simple then one way to proceed is just to split the dataset up by levels
of the single factor and fit smooths to the data for each level].

cheers,
Simon

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list