This function is a slightly adapted version of the
fpca.sc
function in the refund package for
calculating univariate functional principal components based on a smoothed
covariance function. The smoothing basis functions are penalized splines.
.PACE(
X,
Y,
Y.pred = NULL,
nbasis = 10,
pve = 0.99,
npc = NULL,
makePD = FALSE,
cov.weight.type = "none"
)
The approximation of Y.pred
(if NULL
, the
approximation of Y
) based on the functional principal components.
A matrix containing the estimated scores (observations by row).
The estimated mean function.
A matrix containing the estimated eigenfunctions (by row).
The estimated eigenvalues.
The number of principal comopnents that were calculated.
The estimated variance of the measurement error.
The estimated smooth variance function of the data.
A vector of xValues.
A matrix of observed functions (by row).
A matrix of functions (by row) to be approximated using the
functional principal components. Defaults to NULL
, i.e. the
prediction is made for the functions in Y
.
An integer, giving the number of B-spline basis to use.
Defaults to 10
.
A value between 0 and 1, giving the percentage of variance
explained in the data by the functional principal components. This value is
used to choose the number of principal components. Defaults to 0.99
The number of principal components to be estimated. Defaults to
NULL
. If given, this overrides pve
.
Logical, should positive definiteness be enforced for the
covariance estimate? Defaults to FALSE
.
The type of weighting used for the smooth covariance
estimate. Defaults to "none"
, i.e. no weighting. Alternatively,
"counts"
(corresponds to fpca.sc
in refund) weights the pointwise estimates of the covariance function
by the number of observation points.
Di, C., Crainiceanu, C., Caffo, B., and Punjabi, N. (2009). Multilevel functional principal component analysis. Annals of Applied Statistics, 3, 458--488. 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.
PACE