Description Usage Arguments Value See Also Examples
This function calculates a functional principal component basis
representation for functional data on onedimensional domains. The FPCA is
calculated via the PACE
function, which is built on
fpca.sc in the refund package.
1 2 
funDataObject 
An object of class 
nbasis 
An integer, representing the number of Bspline basis
functions used for estimation of the mean function and bivariate smoothing
of the covariance surface. Defaults to 
pve 
A numeric value between 0 and 1, the proportion of variance
explained: used to choose the number of principal components. Defaults to

npc 
An integer, giving a prespecified value for the number of
principal components. Defaults to 
makePD 
Logical: should positive definiteness be enforced for the
covariance surface estimate? Defaults to 
cov.weight.type 
The type of weighting used for the smooth covariance
estimate in 
scores 
A matrix of scores (coefficients) with dimension

ortho 
Logical, set to 
functions 
A functional data object, representing the functional principal component basis functions. 
meanFunction 
The smoothed mean function. 
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17  # simulate N = 100 observations of functional data based on polynomial eigenfunctions on [0,1]
sim < simFunData(argvals = seq(0,1,0.01), M = 5, eFunType = "Poly", eValType = "linear", N = 100)
# estimate the first 5 functional principal components from the data
fpca < MFPCA:::fpcaBasis(sim$simData, npc = 5)
oldpar < par(no.readonly = TRUE)
par(mfrow = c(1,2))
plot(sim$trueFuns, obs = 1:5, main = "True eigenfunctions")
plot(fpca$functions, main = "Estimated eigenfunctions")
# Flip if necessary
plot(sim$trueFuns, obs = 1:5, main = "True eigenfunctions")
plot(flipFuns(sim$trueFuns[1:5], fpca$functions),
main = "Estimated eigenfunctions\n(flipped)")
par(oldpar)

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.