Smooth functional data using penalized B-spline or Fourier basis expansion. Penalized Basis Smoothing
Usage
smooth.basis.fd(
fdataobj,
type = c("bspline", "fourier"),
nbasis = NULL,
lambda = 0,
lfd.order = 2,
period = NULL
)Arguments
- fdataobj
An object of class 'fdata'.
- type
Basis type: "bspline" or "fourier".
- nbasis
Number of basis functions. If NULL, defaults to min(ncol/4, 30).
- lambda
Smoothing parameter (penalty weight). Use 0 for no penalty.
- lfd.order
Order of the linear differential operator for the penalty (default 2 = penalize curvature).
- period
Period for Fourier basis (only used when type = "fourier"). If NULL, defaults to the range of argvals.
Value
An object of class 'smooth.basis' with components:
- coefficients
Matrix of basis coefficients (nbasis x n)
- fitted
Fitted smoothed curves as an fdata object
- edf
Effective degrees of freedom
- gcv
Generalized cross-validation score
- aic
Akaike information criterion
- bic
Bayesian information criterion
- nbasis
Number of basis functions used
- lambda
Smoothing parameter used
- type
Basis type used
- fdataobj
Original functional data
Details
Fits a penalized basis expansion to smooth functional data. Supports B-spline and Fourier basis types with a roughness penalty.