align_fPCA {fdasrvf} | R Documentation |
Group-wise function alignment and PCA Extractions
Description
This function aligns a collection of functions while extracting principal components.
Usage
align_fPCA(
f,
time,
num_comp = 3L,
showplot = TRUE,
smooth_data = FALSE,
sparam = 25L,
parallel = FALSE,
cores = NULL,
max_iter = 51L,
lambda = 0
)
Arguments
f |
A numeric matrix of shape |
time |
A numeric vector of length |
num_comp |
An integer value specifying the number of principal
components to extract. Defaults to |
showplot |
A boolean specifying whether to display plots along the way.
Defaults to |
smooth_data |
A boolean specifying whether to smooth data using box
filter. Defaults to |
sparam |
An integer value specifying the number of times to apply box
filter. Defaults to |
parallel |
A boolean specifying whether computations should run in
parallel. Defaults to |
cores |
An integer value specifying the number of cores to use for
parallel computations. Defaults to |
max_iter |
An integer value specifying the maximum number of iterations.
Defaults to |
lambda |
A numeric value specifying the elasticity. Defaults to |
Value
A list with the following components:
-
f0
: A numeric matrix of shapeM \times N
storing the original functions; -
fn
: A numeric matrix of the same shape asf0
storing the aligned functions; -
qn
: A numeric matrix of the same shape asf0
storing the aligned SRSFs; -
q0
: A numeric matrix of the same shape asf0
storing the SRSFs of the original functions; -
mqn
: A numeric vector of lengthM
storing the mean SRSF; -
gam
: A numeric matrix of the same shape asf0
storing the estimated warping functions; -
vfpca
: A list storing information about the vertical PCA with the following components:-
q_pca
: A numeric matrix of shape(M + 1) \times 5 \times \mathrm{num\_comp}
storing the first3
principal directions in SRSF space; the first dimension isM + 1
because, in SRSF space, the original functions are represented by the SRSF and the initial value of the functions. -
f_pca
: A numeric matrix of shapeM \times 5 \times \mathrm{num\_comp}
storing the first3
principal directions in original space; -
latent
: A numeric vector of lengthM + 1
storing the singular values of the SVD decomposition in SRSF space; -
coef
: A numeric matrix of shapeN \times \mathrm{num\_comp}
storing the scores of theN
original functions on the firstnum_comp
principal components; -
U
: A numeric matrix of shape(M + 1) \times (M + 1)
storing the eigenvectors associated with the SVD decomposition in SRSF space.
-
-
Dx
: A numeric vector of lengthmax_iter
storing the value of the cost function at each iteration.
References
Tucker, J. D., Wu, W., Srivastava, A., Generative models for functional data using phase and amplitude separation, Computational Statistics and Data Analysis (2012), 10.1016/j.csda.2012.12.001.
Examples
## Not run:
out <- align_fPCA(simu_data$f, simu_data$time)
## End(Not run)