Learn R Programming

fda (version 2.4.0)

create.monomial.basis: Create a Monomial Basis

Description

Creates a set of basis functions consisting of powers of the argument.

Usage

create.monomial.basis(rangeval=c(0, 1), nbasis=NULL,
         exponents=NULL, dropind=NULL, quadvals=NULL,
         values=NULL, basisvalues=NULL, names='monomial',
         axes=NULL)

Arguments

rangeval
a vector of length 2 containing the initial and final values of the interval over which the functional data object can be evaluated.
nbasis
the number of basis functions = length(exponents). Default = if(is.null(exponents)) 2 else length(exponents).
exponents
the nonnegative integer powers to be used. By default, these are 0, 1, 2, ..., (nbasis-1).
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 when rangeval[1] = 0, this is achieved by dropping the first basis function, the only one
quadvals
a matrix with two columns and a number of rows equal to the number of quadrature points for numerical evaluation of the penalty integral. The first column of quadvals contains the quadrature points, and the second column the quad
values
a list of matrices with one row for each row of quadvals and one column for each basis function. The elements of the list correspond to the basis functions and their derivatives evaluated at the quadrature points contained in the
basisvalues
A list of lists, allocated by code such as vector("list",1). This field is designed to avoid evaluation of a basis system repeatedly at a set of argument values. Each list within the vector corresponds to a specific set of argument values, a
names
either a character vector of the same length as the number of basis functions or a simple stem used to construct such a vector.

For monomial bases, this defaults to paste('monomial', 1:nbreaks, sep='').

axes
an optional list used by selected plot functions to create custom axes. If this axes argument is not NULL, functions plot.basisfd, plot.fd, plot.fdSmooth

Value

  • a basis object with the type monom.

See Also

basisfd, link{create.basis} create.bspline.basis, create.constant.basis, create.fourier.basis, create.exponential.basis, create.polygonal.basis, create.polynomial.basis, create.power.basis

Examples

Run this code
##
## simplest example: one constant 'basis function'
##
m0 <- create.monomial.basis(nbasis=1)
plot(m0)

##
## Create a monomial basis over the interval [-1,1]
##  consisting of the first three powers of t
##
basisobj <- create.monomial.basis(c(-1,1), 5)
#  plot the basis
plot(basisobj)

##
## rangeval of class Date or POSIXct
##
# Date
invasion1 <- as.Date('1775-09-04')
invasion2 <- as.Date('1812-07-12')
earlyUS.Canada <- c(invasion1, invasion2)
BspInvade1 <- create.monomial.basis(earlyUS.Canada)

# POSIXct
AmRev.ct <- as.POSIXct1970(c('1776-07-04', '1789-04-30'))
BspRev1.ct <- create.monomial.basis(AmRev.ct)

Run the code above in your browser using DataLab