mfpca.sc | R Documentation |
Decomposes functional observations using functional principal components analysis. A mixed model framework is used to estimate scores and obtain variance estimates.
mfpca.sc(
Y = NULL,
id = NULL,
visit = NULL,
twoway = FALSE,
argvals = NULL,
nbasis = 10,
pve = 0.99,
npc = NULL,
makePD = FALSE,
center = TRUE,
cov.est.method = 2,
integration = "trapezoidal"
)
Y |
The user must supply a matrix of functions on a regular grid |
id |
Must be supplied, a vector containing the id information used to identify clusters |
visit |
A vector containing information used to identify visits. Defaults to |
twoway |
logical, indicating whether to carry out twoway ANOVA and calculate visit-specific means. Defaults to |
argvals |
function argument. |
nbasis |
number of B-spline basis functions used for estimation of the mean function and bivariate smoothing of the covariance surface. |
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 |
makePD |
logical: should positive definiteness be enforced for the
covariance surface estimate? Defaults to |
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
|
This function computes a multilevel 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 level 1 and level 2 scores.
MFPCA was proposed in Di et al. (2009), with variations for
MFPCA with sparse data in Di et al. (2014).
mfpca.sc
uses penalized splines to smooth the covariance functions, as
Described in Di et al. (2009) and Goldsmith et al. (2013).
An object of class mfpca
containing:
Yhat |
FPC approximation (projection onto leading components)
of |
Yhat.subject |
estimated subject specific curves for all subjects |
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 for levels 1 and 2. |
npc |
number of FPCs: either the supplied |
sigma2 |
estimated measurement error variance. |
eta |
the estimated visit specific shifts from overall mean. |
Julia Wrobel jw3134@cumc.columbia.edu, Jeff Goldsmith jeff.goldsmith@columbia.edu, and Chongzhi Di
Di, C., Crainiceanu, C., Caffo, B., and Punjabi, N. (2009). Multilevel functional principal component analysis. Annals of Applied Statistics, 3, 458–488.
Di, C., Crainiceanu, C., Caffo, B., and Punjabi, N. (2014). Multilevel sparse functional principal component analysis. Stat, 3, 126–143.
Goldsmith, J., Greven, S., and Crainiceanu, C. (2013). Corrected confidence bands for functional data using principal components. Biometrics, 69(1), 41–51.
## Not run:
data(DTI)
DTI = subset(DTI, Nscans < 6) ## example where all subjects have 6 or fewer visits
id = DTI$ID
Y = DTI$cca
mfpca.DTI = mfpca.sc(Y=Y, id = id, twoway = TRUE)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.