Learn R Programming

fda (version 1.1.8)

mean.fd: Mean of Functional Data

Description

Evaluate the mean of a set of functions in a functional data object.

Usage

mean.fd(x, ...)

Arguments

x
a functional data object.
...
Other arguments to match generic

Value

  • a functional data object with a single replication that contains the mean of the functions in the object fd.

See Also

stddev.fd, var.fd, sum.fd, center.fd

Examples

Run this code
liptime  <- seq(0,1,.02)
liprange <- c(0,1)

#  -------------  create the fd object -----------------
#       use 31 order 6 splines so we can look at acceleration

nbasis <- 51
norder <- 6
lipbasis <- create.bspline.basis(liprange, nbasis, norder)

#  ------------  apply some light smoothing to this object  -------

Lfdobj   <- int2Lfd(4)
lambda   <- 1e-12
lipfdPar <- fdPar(lipbasis, Lfdobj, lambda)

lipfd <- smooth.basis(liptime, lip, lipfdPar)$fd
names(lipfd$fdnames) = c("Normalized time", "Replications", "mm")

lipmeanfd <- mean.fd(lipfd)
plot(lipmeanfd)

Run the code above in your browser using DataLab