fpca {MJMbamlss} | R Documentation |
Functional principal components analysis by smoothed covariance
Description
Decomposes functional observations using functional principal components
analysis. A mixed model framework is used to estimate scores and obtain
variance estimates. This function is a slightly adapted copy of the
fpca.sc
function in package refund
(version 0.1-30).
Usage
fpca(
Y = NULL,
ydata = NULL,
Y.pred = NULL,
argvals = NULL,
argvals_obs = FALSE,
argvals_pred = seq(0, 1, by = 0.01),
random.int = FALSE,
nbasis = 10,
nbasis_cov = nbasis,
bs_cov = "symm",
pve = 0.99,
npc = NULL,
useSymm = FALSE,
makePD = FALSE,
center = TRUE,
cov.est.method = 1,
integration = "trapezoidal"
)
Arguments
Y , ydata |
the user must supply either |
Y.pred |
if desired, a matrix of functions to be approximated using the FPC decomposition. |
argvals |
the argument values of the function evaluations in |
argvals_obs |
Should the timepoints of the original observations be used to evaluate the FPCs. Defaults to FALSE. |
argvals_pred |
Vector of timepoints on which to evaluate the FPCs. Defaults to a sequence from 0 to 1. |
random.int |
If |
nbasis |
number of B-spline basis functions used for estimation of the mean function. |
nbasis_cov |
number of basis functions used for the bivariate smoothing of the covariance surface. |
bs_cov |
type of spline for the bivariate smoothing of the covariance surface. Default is symmetric fast covariance smoothing proposed by Cederbaum. |
pve |
proportion of variance explained: used to choose the number of principal components. |
npc |
prespecified value for the number of principal components (if
given, this overrides |
useSymm |
logical, indicating whether to smooth only the upper
triangular part of the naive covariance (when |
makePD |
logical: should positive definiteness be enforced for the covariance surface estimate? |
center |
logical: should an estimated mean function be subtracted from
|
cov.est.method |
covariance estimation method. If set to |
integration |
quadrature method for numerical integration; only
|
Details
This function computes a FPC decomposition for a set of observed curves, which may be sparsely observed and/or measured with error. A mixed model framework is used to estimate curve-specific scores and variances.
FPCA via kernel smoothing of the covariance function, with the diagonal
treated separately, was proposed in Staniswalis and Lee (1998) and much
extended by Yao et al. (2005), who introduced the 'PACE' method.
fpca.sc
uses penalized splines to smooth the covariance function, as
developed by Di et al. (2009) and Goldsmith et al. (2013). This
implementation uses REML and Cederbaum et al. (2018) for smoothing the
covariance function.
The functional data must be supplied as either
an
n \times d
matrixY
, each row of which is one functional observation, with missing values allowed; ora data frame
ydata
, with columns'.id'
(which curve the point belongs to, sayi
),'.index'
(function argument such as time pointt
), and'.value'
(observed function valueY_i(t)
).
Value
An object of class fpca
containing:
Yhat |
FPC approximation (projection onto leading components)
of |
Y |
the observed data |
scores |
|
mu |
estimated mean
function (or a vector of zeroes if |
efunctions |
|
evalues |
estimated eigenvalues of the covariance operator, i.e., variances of FPC scores. |
npc |
number of FPCs: either the supplied |
argvals |
argument values of eigenfunction evaluations |
sigma2 |
estimated measurement error variance. |
diag.var |
diagonal elements of the covariance matrices for each estimated curve. |
VarMats |
a list containing the estimated
covariance matrices for each curve in |
crit.val |
estimated critical values for constructing simultaneous confidence intervals. |
Author(s)
Jeff Goldsmith jeff.goldsmith@columbia.edu, Sonja Greven sonja.greven@stat.uni-muenchen.de, Lan Huo Lan.Huo@nyumc.org, Lei Huang huangracer@gmail.com, and Philip Reiss phil.reiss@nyumc.org, Alexander Volkmann
References
Cederbaum, J. Scheipl, F. and Greven, S. (2018). Fast symmetric additive covariance smoothing. Computational Statistics & Data Analysis, 120, 25–41.
Di, C., Crainiceanu, C., Caffo, B., and Punjabi, N. (2009). Multilevel functional principal component analysis. Annals of Applied Statistics, 3, 458–488.
Goldsmith, J., Greven, S., and Crainiceanu, C. (2013). Corrected confidence bands for functional data using principal components. Biometrics, 69(1), 41–51.
Staniswalis, J. G., and Lee, J. J. (1998). Nonparametric regression analysis of longitudinal data. Journal of the American Statistical Association, 93, 1403–1418.
Yao, F., Mueller, H.-G., and Wang, J.-L. (2005). Functional data analysis for sparse longitudinal data. Journal of the American Statistical Association, 100, 577–590.