Description Usage Arguments Details Value
These functions generate the mathematical functions for three different basis sets: Fourier (sines), Legendre (orthogonal polynomials), and Splines (low-order smooth approximation)
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)
|
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 |
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.
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.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.