align_fPCA | R Documentation |
This function aligns a collection of functions while extracting principal components.
align_fPCA(
f,
time,
num_comp = 3L,
showplot = TRUE,
smooth_data = FALSE,
sparam = 25L,
parallel = FALSE,
cores = NULL,
max_iter = 51L,
lambda = 0
)
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 |
A list with the following components:
f0
: A numeric matrix of shape M \times N
storing the original
functions;
fn
: A numeric matrix of the same shape as f0
storing the aligned
functions;
qn
: A numeric matrix of the same shape as f0
storing the aligned
SRSFs;
q0
: A numeric matrix of the same shape as f0
storing the SRSFs of the
original functions;
mqn
: A numeric vector of length M
storing the mean SRSF;
gam
: A numeric matrix of the same shape as f0
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 first 3
principal directions in SRSF
space; the first dimension is M + 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 shape M \times 5 \times
\mathrm{num\_comp}
storing the first 3
principal directions in
original space;
latent
: A numeric vector of length M + 1
storing the singular
values of the SVD decomposition in SRSF space;
coef
: A numeric matrix of shape N \times \mathrm{num\_comp}
storing the scores of the N
original functions on the first
num_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 length max_iter
storing the value of the cost
function at each iteration.
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.
## Not run:
out <- align_fPCA(simu_data$f, simu_data$time)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.