Description Usage Arguments Details Value Note Author(s) References See Also Examples
Computes shifted Legendre polynomials.
1 |
p |
the variable for which to compute the polynomials. Must be 0 <= p <= 1. |
k |
the degree of the polynomial. |
intercept |
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 iMqr
.
The constant term is omitted unless intercept = TRUE: for example,
the first two SLP are (2*p - 1, 6*p^2 - 6*p + 1)
,
but slp(p, k = 2)
will only return (2*p, 6*p^2 - 6*p)
.
An object of class “slp
”, i.e.,
a matrix with the same number of rows as p, and with k columns
named slp1, slp2, ...
containing the SLP of the corresponding orders.
The value of k is reported as attribute.
The default for iMqr
is formula.p = ~ slp(p, k = 3)
.
Paolo Frumento paolo.frumento@unipi.it
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 |
Loading required package: pch
Loading required package: survival
slp1
[1,] 0.0
[2,] 0.2
[3,] 0.4
[4,] 0.6
[5,] 0.8
[6,] 1.0
[7,] 1.2
[8,] 1.4
[9,] 1.6
[10,] 1.8
[11,] 2.0
attr(,"k")
[1] 1
attr(,"class")
[1] "slp"
slp1
[1,] -1.0
[2,] -0.8
[3,] -0.6
[4,] -0.4
[5,] -0.2
[6,] 0.0
[7,] 0.2
[8,] 0.4
[9,] 0.6
[10,] 0.8
[11,] 1.0
attr(,"k")
[1] 1
attr(,"class")
[1] "slp"
slp1 slp2 slp3
[1,] 0.0 0.00 0.00
[2,] 0.2 -0.54 0.92
[3,] 0.4 -0.96 1.36
[4,] 0.6 -1.26 1.44
[5,] 0.8 -1.44 1.28
[6,] 1.0 -1.50 1.00
[7,] 1.2 -1.44 0.72
[8,] 1.4 -1.26 0.56
[9,] 1.6 -0.96 0.64
[10,] 1.8 -0.54 1.08
[11,] 2.0 0.00 2.00
attr(,"k")
[1] 3
attr(,"class")
[1] "slp"
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.