leg: Legendre polynomial matrix

View source: R/FUN_stats.R

legR Documentation

Legendre polynomial matrix

Description

Legendre polynomials of order 'n' are created given a vector 'x' and normalized to lay between values u and v.

Usage

  leg(x,n=1,u=-1,v=1, intercept=TRUE, intercept1=FALSE)

Arguments

x

numeric vector to be used for the polynomial.

n

order of the Legendre polynomials.

u

lower bound for the polynomial.

v

upper bound for the polynomial.

intercept

a TRUE/FALSE value indicating if the intercept should be included.

intercept1

a TRUE/FALSE value indicating if the intercept should have value 1 (is multiplied by sqrt(2)).

Value

$S3

an Legendre polynomial matrix of order n.

Author(s)

Giovanny Covarrubias-Pazaran

References

Covarrubias-Pazaran G (2016) Genome assisted prediction of quantitative traits using the R package sommer. PLoS ONE 11(6): doi:10.1371/journal.pone.0156744

See Also

The core functions of the package mmer

Examples

x <- sort(rep(1:3,100))
# you need to install the orthopolynom library
# leg(x, n=1)
# leg(x, n=2)

# see dataset data(DT_legendre) for a random regression modeling example


sommer documentation built on Sept. 11, 2024, 6:22 p.m.