Description Usage Arguments Value Examples
It provides functional principal component analysis for univariate or multivariate functional data.
1 | mfpca(fdobj,center)
|
fdobj |
For univariate FPCA: a functional data object produced by fd() function of fda package, for multivariate FPCA: a list of functional data objects. |
center |
If TRUE (default), it centers each lines of data coefficients by the mean before calculating the FPCA. |
eigval |
A list of eigen values. |
harmonics |
A functional data object for the harmonics or eigenfunctions. |
scores |
A matrix of scores on the harmonics. |
varprop |
A vector giving the proportion of variance explained by each harmonic. |
meanfd |
A functional data object giving the mean function after centering (default) or the mean function of raw data. |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | ####Univariate case: "Canadian temperature" data (Ramsey & Silverman)
daybasis65 <- create.fourier.basis(c(0, 365), nbasis=65, period=365)
daytempfd <- smooth.basis(day.5, CanadianWeather$dailyAv[,,"Temperature.C"], daybasis65,
fdnames=list("Day", "Station", "Deg C"))$fd
res.pca<-mfpca(daytempfd)
plot.mfpca(res.pca)
####Multivariate case: "Canadian temperature" data (Ramsey & Silverman)
daybasis65 <- create.fourier.basis(c(0, 365), nbasis=65, period=365)
daytempfd <- smooth.basis(day.5, CanadianWeather$dailyAv[,,"Temperature.C"], daybasis65,
fdnames=list("Day", "Station", "Deg C"))$fd
dayprecfd<-smooth.basis(day.5, CanadianWeather$dailyAv[,,"Precipitation.mm"], daybasis65,
fdnames=list("Day", "Station", "Mm"))$fd
res.pca<-mfpca(list(daytempfd,dayprecfd))
plot.mfpca(res.pca)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.