poly2form: Expands Design Matrix Based on Polynomials

Description Usage Arguments Value References See Also Examples

View source: R/poly2form.R

Description

This function takes a list of objects having class polynomial, evaluates each polynomial as a function of x, then returns the results in a matrix.

Usage

1
poly2form(poly.out, x)

Arguments

poly.out

A list whose objects are of class polynomial.

x

A vector of values for which each polynomial in poly.out is to be evaluated.

Value

poly.out returns a matrix whose columns are the evaluation of each polynomial in poly.out using x.

References

Young, D. S. (2017), Handbook of Regression Methods, CRC Press.

See Also

legendre.polynomials

Examples

1
2
3
4
5
6
7
8
9
 
## Evaluating the order 5 Legendre polynomials.

require(orthopolynom)

px <- legendre.polynomials(n = 5, normalized = FALSE)
lx <- poly2form(poly.out = px, x = 1:10)

lx

HoRM documentation built on March 11, 2021, 9:07 a.m.