View source: R/Orthogonal_polynomials.R
poly_orth | R Documentation |
Generate a list of polynomials up to a specified degree, orthogonal with respect to the natural inner product on a discrete, finite set of x-values with equal weights.
poly_orth(x, degree = length(unique(x)) - 1, norm = TRUE)
x |
A numeric vector |
degree |
The desired maximum degree |
norm |
Logical: should polynomials be normalised to length one? |
A list of orthogonal polynomials as a polylist object
x <- c(0:3, 5)
P <- poly_orth(x)
plot(P, lty = "solid")
Pf <- as.function(P)
zap(crossprod(Pf(x)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.