# [R] collocation methods

Martin Maechler maechler at stat.math.ethz.ch
Tue Mar 7 09:11:36 CET 2006

```>>>>> "Alex" == Alexander Nervedi <alexnerdy at hotmail.com>
>>>>>     on Mon, 06 Mar 2006 17:31:40 +0000 writes:

Alex> Hi All, I have found the function poly(), that
Alex> computes orthogonal polynomials. I was wondering if
Alex> there are users of this function on the list. What
Alex> kind of an orthognal polynomial is this fititng ? Is
Alex> it, for example, least square, galerkin, or
Alex> collocation ?

poly() computes an orthogonal *basis*, orthogonal with respect to
the simple n-dimensional scalar product  <u,v> :=  sum_{i=1}^n  u_i * v_i

and where the k-th basis vector is a k-th order polynomial in
the arguments of poly.

This should clear from  ?poly  -- did you read that?

Maybe the following helps:

x <- c(0:3,5,7,11,13,17,19)
p3 <- poly(x, degree=3)
p3
matplot(x, p3, type = "o")

One important use of poly() is in a formula which is used in
lm().  In that case, of course least squares polynomials are fit.

Martin Maechler,
ETH Zurich

Alex> It references Chambers and Hastie, and Kennedy and