Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

poly_orth

Simpl orthogonal polynomials


Description

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.

Usage

poly_orth(x, degree = length(unique(x)) - 1, norm = TRUE)

Arguments

x

A numeric vector

degree

The desired maximum degree

norm

Logical: should polynomials be normalised to length one?

Value

A list of orthogonal polynomials as a polylist object

Examples

x <- c(0:3, 5)
P <- poly_orth(x)
plot(P, lty = "solid")
Pf <- as.function(P)
zap(crossprod(Pf(x)))

PolynomF

Polynomials in R

v2.0-3
GPL-2
Authors
Bill Venables, with contribution by Kurt Hornik and Georgi Boshnakov
Initial release
2020-02-04

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.