center.fd | R Documentation |
Subtract the pointwise mean from each of the functions in a functional data object; that is, to center them on the mean function.
center.fd(fdobj)
fdobj |
a functional data object to be centered. |
a functional data object whose mean is zero.
Ramsay, James O., Hooker, Giles, and Graves, Spencer (2009), Functional data analysis with R and Matlab, Springer, New York.
Ramsay, James O., and Silverman, Bernard W. (2005), Functional Data Analysis, 2nd ed., Springer, New York.
Ramsay, James O., and Silverman, Bernard W. (2002), Applied Functional Data Analysis, Springer, New York.
mean.fd
,
sum.fd
,
stddev.fd
,
std.fd
daytime <- (1:365)-0.5
daybasis <- create.fourier.basis(c(0,365), 365)
harmLcoef <- c(0,(2*pi/365)^2,0)
harmLfd <- vec2Lfd(harmLcoef, c(0,365))
templambda <- 0.01
dayfd <- fda::fd(matrix(0, daybasis$nbasis, 1), daybasis)
tempfdPar <- fda::fdPar(dayfd, harmLfd, templambda)
# do not run on CRAN because it takes too long.
tempfd <- smooth.basis(daytime,
CanadianWeather$dailyAv[,,"Temperature.C"], tempfdPar)$fd
tempctrfd <- center.fd(tempfd)
oldpar <- par(no.readonly= TRUE)
plot(tempctrfd, xlab="Day", ylab="deg. C",
main = "Centered temperature curves")
par(oldpar)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.