View source: R/Orthogonal_polynomials.R
poly_orth_general | R Documentation |
Generate sets of polynomials orthogonal with respect to a general inner product. The inner product is specified by an R function of (at least) two polynomial arguments.
poly_orth_general(inner_product, degree, norm = FALSE, ...)
Hermite(p, q = p)
Legendre(p, q = p)
ChebyshevT(p, q = p)
ChebyshevU(p, q = p)
Jacobi(p, q = p, alpha = -0.5, beta = alpha)
Discrete(p, q = p, x, w = function(x, ...) 1, ...)
inner_product |
An R function of two |
degree |
A non-negative integer specifying the maximum degree |
norm |
Logical: should the polynomials be normalized? |
... |
additional arguments passed on to the inner product function |
p , q |
Polynomials |
alpha , beta |
Family parameters for the Jacobi polynomials |
x |
numeric vector defining discrete orthogonal polynomials |
w |
a weight function for discrete orthogonal polynomials |
Discrete orthogonal polynomials, equally or unequally weighted,
are included as special cases. See the Discrete
inner
product function.
Computations are done using the recurrence relation with computed coefficients. If the algebraic expressions for these recurrence relation coefficients are known the computation can be made much more efficient.
A "polylist"
object containing the orthogonal set
(P0 <- poly_orth(0:5, norm = FALSE))
(P1 <- poly_orth_general(Discrete, degree = 5, x = 0:5, norm = FALSE))
sapply(P0-P1, function(x) max(abs(coef(x)))) ## visual check for equality
(P0 <- poly_orth_general(Legendre, 5))
### should be same as P0, up to roundoff
(P1 <- poly_orth_general(Jacobi, 5, alpha = 0, beta = 0))
### check
sapply(P0-P1, function(x) max(abs(coef(x))))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.