legendre_basis: Generate Legendre Polynomial Basis

Description Usage Arguments Value Examples

View source: R/utils.R

Description

This function is just a wrapper of two functions from the 'orthopolynom' R package. The Legendre poloynomial basis is orthogonal on [-1,1], hence context observations should be mapped to this domain.

Usage

1

Arguments

J

The number of basis functions to generate (NOT INCLUDING THE INTERCEPT).

Value

A list of functions. If J = 5, the list will have a length of 6 due to the intercept.

Examples

1
2
J <- 5
legendre_basis(J) # output will be length 6 and include the intercept.

dfcorbin/MABsim documentation built on April 26, 2020, 8:26 a.m.