Learn R Programming

fda (version 6.2.0)

polyg: Polygonal Basis Function Values

Description

Evaluates a set of polygonal basis functions, or a derivative of these functions, at a set of arguments.

Usage

polyg(x, argvals, nderiv=0)

Value

a matrix of function values. The number of rows equals the number of arguments, and the number of columns equals the number of basis

Arguments

x

a vector of argument values at which the polygonal basis functions are to evaluated.

argvals

a strictly increasing set of argument values containing the range of x within it that defines the polygonal basis. The default is x itself.

nderiv

the order of derivative to be evaluated. The derivative must not exceed one. The default derivative is 0, meaning that the basis functions themselves are evaluated.

References

Ramsay, James O., Hooker, Giles, and Graves, Spencer (2009), Functional data analysis with R and Matlab, Springer, New York.

Ramsay, James O., and Silverman, Bernard W. (2005), Functional Data Analysis, 2nd ed., Springer, New York.

Ramsay, James O., and Silverman, Bernard W. (2002), Applied Functional Data Analysis, Springer, New York.

See Also

create.polygonal.basis, polygpen

Examples

Run this code
oldpar <- par(no.readonly=TRUE)
#  set up a set of 21 argument values
x <- seq(0,1,0.05)
#  set up a set of 11 argument values
argvals <- seq(0,1,0.1)
#  with the default period (1) and derivative (0)
basismat <- polyg(x, argvals)
#  plot the basis functions
matplot(x, basismat, type="l")
par(oldpar)

Run the code above in your browser using DataLab