Learn R Programming

fda (version 1.2.3)

eval.fd: Values of a Functional Data Object

Description

Evaluate a functional data object at specified argument values, or evaluate a derivative or the result of applying a linear differential operator to the functional object.

Usage

eval.fd(evalarg, fdobj, Lfdobj=0)

Arguments

evalarg
a vector of argument values at which the functional data object is to be evaluated.
fdobj
a functional data object to be evaluated.
Lfdobj
either a nonnegative integer or a linear differential operator object. If present, the derivative or the value of applying the operator is evaluated rather than the functions themselves.

Value

  • an array of 2 or 3 dimensions containing the function values. The first dimension corresponds to the argument values in evalarg, the second to replications, and the third if present to functions.

See Also

getbasismatrix, eval.bifd, eval.penalty, eval.monfd, eval.posfd

Examples

Run this code
#    set up the fourier basis
daybasis <- create.fourier.basis(c(0, 365), nbasis=65)
#  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
#  Convert the data to a functional data object
tempfd <- data2fd(CanadianWeather$dailyAv[,,"Temperature.C"],
                   day.5, daybasis)
#   set up the harmonic acceleration operator
Lbasis  <- create.constant.basis(c(0, 365))
Lcoef   <- matrix(c(0,(2*pi/365)^2,0),1,3)
bfdobj  <- fd(Lcoef,Lbasis)
bwtlist <- fd2list(bfdobj)
harmaccelLfd <- Lfd(3, bwtlist)
#   evaluate the value of the harmonic acceleration
#   operator at the sampling points
Ltempmat <- eval.fd(day.5, tempfd, harmaccelLfd)
#  Plot the values of this operator
matplot(day.5, Ltempmat, type="l")

Run the code above in your browser using DataLab