Functional Principal Components Analysis
pca.fd |
Language Reference for FDA Library
|
Functional Principal Components Analysis
DESCRIPTION:
Functional Principal components analysis aims to display types of
variation across a sample of functions. Principal components analysis is
an exploratory data analysis
that tends to be an early part of many projects. These modes of variation are
called principal components or harmonics. This
function computes these harmonics, the eigenvalues that indicate how
important each mode of variation, and harmonic scores for
individual functions. If the functions are multivariate, these
harmonics are combined into a composite function that summarizes joint
variation among the several functions that make up a multivariate
functional observation.
USAGE:
pca.fd(fdobj, nharm = 2, harmfdPar=fdPar(),
centerfns = T)
REQUIRED ARGUMENTS:
- fdobj
-
a functional data object.
OPTIONAL ARGUMENTS:
- nharm
-
the number of harmonics or principal components to compute.
- harmfdPar
-
a functional parameter object that defines the
harmonic or principal component functions to be estimated.
- centerfns
-
a logical value:
if T, subtract the mean function from each function before
computing principal components.
VALUE:
an object of class "pca.fd" with these named entries:
- harmonics
-
a functional data object for the harmonics or eigenfunctions
- values
-
the complete set of eigenvalues
- scores
-
s matrix of scores on the principal components or harmonics
- varprop
-
a vector giving the proportion of variance explained
by each eigenfunction
- meanfd
-
a functional data object giving the mean function
SEE ALSO:
cca.fd, pda.fd
EXAMPLES:
# carry out a PCA of temperature
# penalize harmonic acceleration, use varimax rotation
harmfdPar <- fdPar(daybasis65, harmaccelLfd, 1e5)
daytemppcaobj <- pca.fd(daytempfd, nharm=4, harmfdPar)
daytemppcaobj <- varmx.pca.fd(daytemppcaobj)
# plot harmonics
plot.pca.fd(daytemppcaobj, cex=1.2)