This function aligns a collection of functions while extracting principal components.
align_fPCA(
f,
time,
num_comp = 3,
showplot = T,
smooth_data = FALSE,
sparam = 25,
parallel = FALSE,
cores = 8,
MaxItr = 51
)
matrix (\(N\) x \(M\)) of \(M\) functions with \(N\) samples
vector of size \(N\) describing the sample points
number of principal components to extract (default = 3)
shows plots of functions (default = T)
smooth data using box filter (default = F)
number of times to apply box filter (default = 25)
enable parallel mode using foreach
and
doParallel
package
set number of cores to use with doParallel
(default = 2)
maximum number of iterations
Returns a list containing
original functions
aligned functions - matrix (\(N\) x \(M\)) of \(M\) functions with \(N\) samples
aligned srvfs - similar structure to fn
original srvfs - similar structure to fn
srvf mean - vector of length \(N\)
warping functions - vector of length \(N\)
cost function
list containing
srvf principal directions
f principal directions
latent values
coefficients
eigenvectors
Tucker, J. D., Wu, W., Srivastava, A., Generative Models for Function Data using Phase and Amplitude Separation, Computational Statistics and Data Analysis (2012), 10.1016/j.csda.2012.12.001.
# NOT RUN {
data("simu_data")
out = align_fPCA(simu_data$f,simu_data$time)
# }
Run the code above in your browser using DataLab