fpca: Functional Principal Component Analysis

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/fpca.R

Description

Compute the functional PCA from a set of curves.

Usage

1
2
fpca( x, nbasisInit, propVar = 0.9, reconstruct = FALSE, 
      varName = NULL, verbose = FALSE)

Arguments

x

The set of curves.

nbasisInit

The number of initial spline coefficients.

propVar

The proportion of explained variance.

reconstruct

Should the data be reconstruct after dimension reduction ?

varName

The name of the current functional variable.

verbose

Should the details be printed.

Details

The Functional PCA is performed in two steps. First we express each discretized curves as a linear combination of ‘nbasisInit’ spline basis functions. Then a multivariate PCA is computed on the spline coefficients. The final number of principal components is chosen such that the proportion of explained variance is larger than ‘propVar’.

Value

A list with two components:

design

The matrix of the principal components ;

smoothData

The reconstructed data if ‘reconstruct == TRUE’.

Author(s)

Baptiste Gregorutti

References

Ramsay, J. O., and Silverman, B. W. (2006), Functional Data Analysis, 2nd ed., Springer, New York.

See Also

hardThresholding

Examples

1
2
3
4
5
  data(toyRegFD)
  x <- toyRegFD$FDlist[[1]]
  PCs <- fpca(x=x, nbasisInit=32, propVar=.9, reconstruct=TRUE)
  plot(x[1,])
  lines(PCs$smoothData[1,], col=2)

Example output

Loading required package: randomForest
randomForest 4.6-14
Type rfNews() to see new features/changes/bug fixes.
Loading required package: wmtsa
Loading required package: fda
Loading required package: splines
Loading required package: Matrix

Attaching package: 'fda'

The following object is masked from 'package:graphics':

    matplot

RFgroove documentation built on May 2, 2019, 8:31 a.m.