Learn R Programming

PolynomF (version 2.0-8)

poly_orth_general: General Orthogonal Polynomials

Description

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.

Usage

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, ...)

Value

A "polylist" object containing the orthogonal set

Arguments

inner_product

An R function of two "polynom" arguments with the second polynomial having a default value equal to the first. Additional arguments may be specified. See examples

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

Details

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.

Examples

Run this code
(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))))

Run the code above in your browser using DataLab