This is the constructor function for objects of the fd
class.
Each function that sets up an object of this class must call this
function. This includes functions smooth.basis
, density.fd
, and so forth
that estimate functional data objects that smooth or otherwise
represent data. Ordinarily, users of the functional data analysis
software will not need to call this function directly, but these notes
are valuable to understanding the components of a list
of class
fd
.
fd(coef=NULL, basisobj=NULL, fdnames=NULL)
A functional data object (i.e., having class fd
), which is a
list with components named coefs
, basis
, and
fdnames
.
a vector, matrix, or three-dimensional array of coefficients.
The first dimension (or elements of a vector) corresponds to basis functions.
A second dimension corresponds to the number of functional
observations, curves or replicates. If coef
is a vector, it
represents only a single functional observation.
If coef
is an array, the third dimension corresponds to
variables for multivariate functional data objects.
A functional data object is "univariate" if coef
is a vector
or matrix and "multivariate" if it is a three-dimensional array.
if(is.null(coef)) coef <- rep(0, basisobj[['nbasis']])
a functional basis object defining the basis
if(is.null(basisobj)){
if(is.null(coef)) basisobj <- basisfd()
else {
rc <- range(coef)
if(diff(rc)==0) rc <- rc+0:1
nb <- max(4, nrow(coef))
basisobj <- create.bspline.basis(rc, nbasis = nb)
}
}
A list of length 3, each member being a string vector containing labels for the levels of the corresponding dimension of the discrete data. The first dimension is for argument values, and is given the default name "time", the second is for replications, and is given the default name "reps", and the third is for functions, and is given the default name "values".
To check that an object is of this class, use function
is.fd
.
Normally only developers of new functional data analysis functions will actually need to use this function.
smooth.basis
smooth.fdPar
smooth.basisPar
density.fd
create.bspline.basis
arithmetic.fd