Define a Functional Parameter Object
fdPar
Language Reference for FDA Library

Define a Functional Parameter Object

DESCRIPTION:

Functional parameter objects are used as arguments to functions that estimate functional parameters, such as smoothing functions like smooth.basis A functional parameter object is a functional data object along with additional slots specifying a roughness penalty, a smoothing parameter and whether or not the functional parameter is to be estimated or held fixed. Functional parameter objects are used as arguments to functions that estimate functional parameters.

USAGE:

fdPar(fdobj=fd(), Lfdobj=int2Lfd(0), lambda=0,
      estimate=T, penmat=NULL)

OPTIONAL ARGUMENTS:

fdobj
a functional data object, although the argument also be a functional basis object or another functional parameter object. Basis objects are converted to functional data objects with the identity matrix as the coefficient matrix.
Lfdobj
either a nonnegative integer or a linear differential operator object
lambda
a nonnegative real number specifying the amount of smoothing to be applied to the estimated functional parameter.
estimate
a logical value: if T, the functional parameter is estimated, otherwise, it is held fixed.
penmat
a roughness penalty matrix. Including this can eliminate the need to compute this matrix over and over again in some types of calculations.

VALUE:

a functional parameter object

DETAILS:

(p> Functional parameters are often needed to specify initial values for iteratively refined estimates, as is the case in functions register.fd and smooth.monotone.

Often a list of functional parameters must be supplied to a function as an argument, and it may be that some of these parameters are considered known and must remain fixed during the analysis. This is the case for functions fRegress and pda.fd, for example.

SEE ALSO:

cca.fd, density.fd, fRegress, intensity.fd, pca.fd, pda.fd smooth.basis, smooth.monotone, smooth.ps

EXAMPLES:

#  smooth the daily temperature data with a roughness
#  penalty
#    set up the fourier basis
nbasis   <- 365
dayrange <- c(0,365)
daybasis <- create.fourier.basis(dayrange, nbasis)
#  Make temperature fd object
#  Temperature data are in 12 by 365 matrix tempav
#    See analyses of weather data.
#  Set up sampling points at mid days
daytime  <- (1:365)-0.5
#  Convert the data to a functional data object
tempfd <- smooth.basis(tempav, daytime, tempfdPar)
#  Set up the harmonic acceleration operator
Lbasis  <- create.constant.basis(dayrange);
Lcoef   <- matrix(c(0,(2*pi/365)^2,0),1,3)
bfdobj  <- fd(Lcoef,Lbasis)
bwtlist <- fd2list(bfdobj)
harmaccelLfd <- Lfd(3, bwtlist)
#  Define the functional parameter object for
#  smoothing the temperature data
lambda   <- 0.01  #  minimum GCV estimate
tempPar <- fdPar(daybasis365, harmaccelLfd, lambda)
#  smooth the data
tempfd <- smooth.basis(daytime, tempav, tempPar)$fd
#  plot the temperature curves
plot(tempfd)