Title: | Functional Principal Component Analysis |
---|---|
Description: | Functional principal component analysis under the Linear Mixed Models representation of smoothing splines. The method utilizes the Demmler-Reinsch basis and assumes error independence. For more details see: F. Rosales (2016) <https://ediss.uni-goettingen.de/handle/11858/00-1735-0000-0028-87F9-6>. |
Authors: | Francisco Rosales [aut, cph, cre], Tatyana Krivobokova [con, ths] |
Maintainer: | Francisco Rosales <[email protected]> |
License: | GPL-2 |
Version: | 9.0 |
Built: | 2024-11-05 04:27:30 UTC |
Source: | https://github.com/cran/funpca |
Performs functional principal component analysis using the mixed models representation of smoothing splines.
Package: | fpcamm |
Version: | 1.0 |
Date: | 2023-06-08 |
Depends: | Brobdingnag, MASS, nlme |
Index:
funpca Performs FPCA using the MM representation of penalized splines. plot.funpca Plots fitted curves: overall trend, subj spec deviations and derivative of the mean curve. summary.funpca Summary of individual fits.
The function funpca()
is used to fit the model. Using the resulting funpca
object, fitted curves or their derivatives can be plotted with plot
and summary information on the fit can be printed using summary
.
Francisco Rosales Maintainer: Francisco Rosales [email protected]
Rosales, F.
For more details see <https://ediss.uni-goettingen.de/handle/11858/00-1735-0000-0028-87F9-6>
fda
(package fda)
Performs functional principal component analysis using the mixed models representation of smoothing splines.
funpca(mat,k)
funpca(mat,k)
mat |
Is a rectangular matrix with no missing values.Each colum represents a sample. |
k |
Desired number of eigen functions to construct subj spec deviations. Should be between 1 and the sample size. |
The method assumes DATA is a complete rectangular matrix and hence does not support missing values.
A list object of class funpca
containing the following information.
est |
Mixed model estimation |
f |
A matrix with the fitted overall trend. All columns contain the same information |
di |
A matrix with the fitted subj spec deviations |
fi |
Fitted values for each subject, i.e. fitted overall trend + fitted subj spec deviations + subj spec seasonality. |
error |
Remainder component for each subject. |
residuals |
Remainder component for each subject. |
y |
Data used for all the computations. |
call |
Call of funpca. |
Francisco Rosales [email protected],
Rosales, F.
For more details see <https://ediss.uni-goettingen.de/handle/11858/00-1735-0000-0028-87F9-6>
fda
(package fda)
library(fda) sdata <- NULL data <- CanadianWeather$monthlyTemp for(i in 1:ncol(data)) sdata <- cbind(sdata,spline(data[,i])$y) x <- funpca(sdata, k=3)
library(fda) sdata <- NULL data <- CanadianWeather$monthlyTemp for(i in 1:ncol(data)) sdata <- cbind(sdata,spline(data[,i])$y) x <- funpca(sdata, k=3)
Plots fitted signals and shows acf/pacf for the each one. Additionally a plot for all curves is added at the beginning.
## S3 method for class 'funpca' plot(x,...)
## S3 method for class 'funpca' plot(x,...)
x |
|
... |
Other arguments to be called by plot(). |
Plot of the fitted results.
The function returns the selected plots.
Francisco Rosales
Rosales, F.
For more details see <https://ediss.uni-goettingen.de/handle/11858/00-1735-0000-0028-87F9-6>
plot.funpca
(package funpca)
library(fda) sdata <- NULL data <- CanadianWeather$monthlyTemp for(i in 1:ncol(data)) sdata <- cbind(sdata,spline(data[,i])$y) x <- funpca(sdata, k=3) plot(x)
library(fda) sdata <- NULL data <- CanadianWeather$monthlyTemp for(i in 1:ncol(data)) sdata <- cbind(sdata,spline(data[,i])$y) x <- funpca(sdata, k=3) plot(x)
Takes an funpca
object produced by funpca
and summarizes the information of the components fi (individual fits).
## S3 method for class 'funpca' summary(object,...)
## S3 method for class 'funpca' summary(object,...)
object |
|
... |
further arguments to be passed to summary(). |
The function gives basic statistics of the components resulting from applying funpca
.
Francisco Rosales [email protected]
Rosales, F. and Krivobokova, T.
For more details see <https://ediss.uni-goettingen.de/handle/11858/00-1735-0000-0028-87F9-6>
plot.funpca
(package funpca),
library(fda) sdata <- NULL data <- CanadianWeather$monthlyTemp for(i in 1:ncol(data)) sdata <- cbind(sdata,spline(data[,i])$y) x <- funpca(sdata, k=3) summary(x)
library(fda) sdata <- NULL data <- CanadianWeather$monthlyTemp for(i in 1:ncol(data)) sdata <- cbind(sdata,spline(data[,i])$y) x <- funpca(sdata, k=3) summary(x)