Decompose dense or sparse multilevel functional observations using multilevel functional principal component analysis with the fast covariance estimation approach.
mfpca.face(
Y,
id,
visit = NULL,
twoway = TRUE,
weight = "obs",
argvals = NULL,
pve = 0.99,
npc = NULL,
pve2 = NULL,
npc2 = NULL,
p = 3,
m = 2,
knots = 35,
silent = TRUE
)
A list containing:
FPC approximation (projection onto leading components)
of Y
, estimated curves for all subjects and visits
Estimated subject specific curves for all subjects
The observed data
estimated mean function (or a vector of zeroes if center==FALSE
).
The estimated visit specific shifts from overall mean.
A matrix of estimated FPC scores for level1 and level2.
A matrix of estimated eigenfunctions of the functional covariance, i.e., the FPC basis functions for levels 1 and 2.
Estimated eigenvalues of the covariance operator, i.e., variances of FPC scores for levels 1 and 2.
The percent variance explained by the returned number of PCs.
Number of FPCs: either the supplied npc
, or the minimum
number of basis functions needed to explain proportion pve
of the
variance in the observed curves for levels 1 and 2.
Estimated measurement error variance.
A multilevel functional dataset on a regular grid stored in a matrix. Each row of the data is the functional observations at one visit for one subject. Missingness is allowed and need to be labeled as NA. The data must be specified.
A vector containing the id information to identify the subjects. The data must be specified.
A vector containing information used to identify the visits. If not provided, assume the visit id are 1,2,... for each subject.
Logical, indicating whether to carry out twoway ANOVA and
calculate visit-specific means. Defaults to TRUE
.
The way of calculating covariance. weight = "obs"
indicates
that the sample covariance is weighted by observations. weight = "subj"
indicates that the sample covariance is weighted equally by subjects. Defaults to "obs"
.
A vector containing observed locations on the functional domain.
Proportion of variance explained. This value is used to choose the number of principal components for both levels.
Pre-specified value for the number of principal components.
If given, this overrides pve
.
Proportion of variance explained in level 2. If given, this overrides
the value of pve
for level 2.
Pre-specified value for the number of principal components in level 2.
If given, this overrides npc
for level 2.
The degree of B-splines functions to use. Defaults to 3.
The order of difference penalty to use. Defaults to 2.
Number of knots to use or the vectors of knots. Defaults to 35.
Logical, indicating whether to not display the name of each step.
Defaults to TRUE
.
Ruonan Li rli20@ncsu.edu, Erjia Cui ecui@umn.edu
The fast MFPCA approach (Cui et al., 2023) uses FACE (Xiao et al., 2016) to estimate
covariance functions and mixed model equations (MME) to predict
scores for each level. As a result, it has lower computational complexity than
MFPCA (Di et al., 2009) implemented in the mfpca.sc
function, and
can be applied to decompose data sets with over 10000 subjects and over 10000
dimensions.
Cui, E., Li, R., Crainiceanu, C., and Xiao, L. (2023). Fast multilevel functional principal component analysis. Journal of Computational and Graphical Statistics, 32(3), 366-377.
Di, C., Crainiceanu, C., Caffo, B., and Punjabi, N. (2009). Multilevel functional principal component analysis. Annals of Applied Statistics, 3, 458-488.
Xiao, L., Ruppert, D., Zipunnikov, V., and Crainiceanu, C. (2016). Fast covariance estimation for high-dimensional functional data. Statistics and Computing, 26, 409-421.
data(DTI)
mfpca.DTI <- mfpca.face(Y = DTI$cca, id = DTI$ID, twoway = TRUE)
Run the code above in your browser using DataLab