basis_sets: Basis sets for for function approximation

Description Usage Arguments Details Value

Description

These functions generate the mathematical functions for three different basis sets: Fourier (sines), Legendre (orthogonal polynomials), and Splines (low-order smooth approximation)

Usage

1
2
3
4
5
6
7
8
9
legendre_set(df = 3, left = -1, right = 1)

legendre_M(x, df, left = -1, right = 1)

ns_set(df = 3, left = -1, right = 1)

fourier_M(x, n, fperiod = NULL)

fourier_set(df, left = -1, right = 1)

Arguments

df

number of basis functions to construct

left

number giving left-hand boundary of the interval

right

number giving right-hand boundary of the interval

fperiod

number giving the fundamental period length for the Fourier basis

Details

For each basis, there are two different forms for the generating functions. Names ending in _set create a set of functions with arguments x and n, where integer n provides an index into the set. The same names with a _M suffix produce a model matrix corresponding to a specified set of x values. These are useful with lm() and similar model-building functions in the same way that poly() and ns() are useful. (ns_M() is just an alias for splines::ns().) Like poly() and ns(), the _M suffix functions do NOT include an intercept column.

Value

The _M functions return a model matrix. The _set functions return a function with arguments x and n. The integer n specifies which function to use, while x is the set of values at which to evaluate that function.


dtkaplan/mosaicUSAFA documentation built on Aug. 21, 2021, 10:37 p.m.