
Last chance! 50% off unlimited learning
Sale ends in
Plots all the basis functions.
# S3 method for basisfd
plot(x, knots=TRUE, axes=NULL, ...)
none
a basis object
logical: If TRUE and x[['type']] == 'bspline', the knot locations are plotted using vertical dotted, red lines. Ignored otherwise.
Either a logical or a list or NULL
.
whether axes should be drawn on the plot
a list used to create custom axes
used to create axes via
x$axes[[1]]
and x$axes[-1]
. The primary example of
this uses list("axesIntervals", ...)
, e.g., with
Fourier
bases to create CanadianWeather
plots
additional plotting parameters passed to matplot
.
a plot of the basis functions
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.
plot.fd
oldpar <- par(no.readonly=TRUE)
##
## 1. b-spline
##
# set up the b-spline basis for the lip data, using 23 basis functions,
# order 4 (cubic), and equally spaced knots.
# There will be 23 - 4 = 19 interior knots at 0.05, ..., 0.95
lipbasis <- create.bspline.basis(c(0,1), 23)
# plot the basis functions
plot(lipbasis)
##
## 2. Fourier basis
##
yearbasis3 <- create.fourier.basis(c(0,365),
axes=list("axesIntervals") )
# plot the basis
plot(yearbasis3)
##
## 3. With Date and POSIXct rangeval
##
# Date
July4.1776 <- as.Date('1776-07-04')
Apr30.1789 <- as.Date('1789-04-30')
AmRev <- c(July4.1776, Apr30.1789)
BspRevolution <- create.bspline.basis(AmRev)
plot(BspRevolution)
# POSIXct
July4.1776ct <- as.POSIXct1970('1776-07-04')
Apr30.1789ct <- as.POSIXct1970('1789-04-30')
AmRev.ct <- c(July4.1776ct, Apr30.1789ct)
BspRev.ct <- create.bspline.basis(AmRev.ct)
plot(BspRev.ct)
par(oldpar)
Run the code above in your browser using DataLab