Create a Polynomial Basis
create.polynomial.basis |
Language Reference for FDA Library
|
Create a Polynomial Basis
DESCRIPTION:
Creates a set of basis functions consisting of powers
of the argument shifted by a constant.
USAGE:
create.polynomial.basis(rangeval=c(0, 1), nbasis=2,
ctr=midrange, dropind=NULL,
quadvals=NULL, values=NULL)
OPTIONAL ARGUMENTS:
- rangeval
-
a vector of length 2 defining the range.
- nbasis
-
the number of basis functions. The default is 2,
which defines a basis for straight lines.
- ctr
-
this value is used to shift the argument prior to taking
its power.
- dropind
-
a vector of integers specifiying the basis functions to
be dropped, if any. For example, if it is required that
a function be zero at the left boundary, this is achieved
by dropping the first basis function, the only one that
is nonzero at that point. Default value NULL.
- quadvals
-
a matrix with two columns and a number of rows equal to the number of
argument values used to approximate an integral using Simpson's rule.
The first column contains these argument values.
A minimum of 5 values are required for
each inter-knot interval, and that is often enough. These
are equally spaced between two adjacent knots.
The second column contains the weights used for Simpson's
rule. These are proportional to 1, 4, 2, 4, ..., 2, 4, 1.
- values
-
a list containing the basis functions and their derivatives
evaluated at the quadrature points contained in the first
column of
quadvals
.
VALUE:
a basis object with the type
polynom
.
DETAILS:
The only difference between a monomial and a polynomial basis
is the use of a shift value. This helps to avoid rounding error
when the argument values are a long way from zero.
SEE ALSO:
basisfd, create.bspline.basis, create.constant.basis, create.fourier.basis,
create.exponential.basis, create.monomial.basis, create.polygonal.basis,
create.power.basis
EXAMPLES:
# Create a polynomial basis over the years in the 20th century
# and center the basis functions on 1950.
basisobj <- create.polynomial.basis(c(1900, 2000), nbasis=3, ctr=1950)
# plot the basis
plot(basisobj)