Computes shifted Legendre polynomials.
the variable for which to compute the polynomials. Must be 0 <= p <= 1.
the degree of the polynomial.
logical. If TRUE, the polynomials include the constant term.
Shifted Legendre polynomials (SLP) are orthogonal polynomial functions in (0,1) that can be used
to build a spline basis, typically within a call to
The constant term is omitted unless intercept = TRUE: for example,
the first two SLP are
(2*p - 1, 6*p^2 - 6*p + 1),
slp(p, k = 2) will only return
(2*p, 6*p^2 - 6*p).
An object of class “
a matrix with the same number of rows as p, and with k columns
slp1, slp2, ... containing the SLP of the corresponding orders.
The value of k is reported as attribute.
The estimation algorithm of
iqr is optimized for objects of class “slp”,
which means that using
formula.p = ~ slp(p, k) instead of
formula.p = ~ p + I(p^2) + ... + I(p^k) will result in a quicker
computation, even with k = 1, with equivalent results.
The default for
formula.p = ~ slp(p, k = 3).
Paolo Frumento firstname.lastname@example.org
Refaat El Attar (2009), Legendre Polynomials and Functions, CreateSpace, ISBN 978-1-4414-9012-4.
plf, for piecewise linear functions in the unit interval.
1 2 3 4