Last chance! 50% off unlimited learning
Sale ends in
KFPCA for non-Gaussian functional data with dense and regular design.
KFPCA_reg(Lt, Ly, nGrid, nK, fdParobj)
A list
of n vectors, where n is the sample size. Each entry contains the observation time in ascending order for each subject. The observation times are the same for each subject.
A list
of n vectors, where n is the sample size. Each entry contains the measurements of each subject at the observation time correspond to Lt
.
An integer denoting the number of observation time for each subject.
An integer denoting the number of FPCs.
A functional parameter object for the smoothing of mean function and eigenfunctions. For more detail, see smooth.basis
.
A list
containing the following components:
A functional data object for the mean function estimates.
A list
containing nK
functional data objects, which are the eigenfunction estimates.
A n by nK
matrix
containing the estimates of the FPC scores, where n is the sample size.
A scalar denoting the computation time.
Rou Zhong, Shishi Liu, Haocheng Li, Jingxiao Zhang (2021). "Functional principal component analysis estimator for non-Gaussian data." <arXiv: https://arxiv.org/abs/2102.01286>.
# NOT RUN {
# Generate data
n <- 100
interval <- c(0, 10)
lambda_1 <- 16 #the first eigenvalue
lambda_2 <- 9 #the second eigenvalue
eigfun <- list()
eigfun[[1]] <- function(x){cos(pi * x/10)/sqrt(5)}
eigfun[[2]] <- function(x){sin(pi * x/10)/sqrt(5)}
score <- cbind(rnorm(n, 0, sqrt(lambda_1)), rnorm(n, 0, sqrt(lambda_2)))
DataNew <- GenDataKL(n, interval = interval, sparse = 51, regular = TRUE,
meanfun = function(x){0}, score = score,
eigfun = eigfun, sd = sqrt(0.25))
basis <- fda::create.bspline.basis(interval, nbasis = 13, norder = 4,
breaks = seq(0, 10, length.out = 11))
#KFPCA
Klist <- KFPCA_reg(DataNew$Lt, DataNew$Ly, nGrid = 51, nK = 2, fdParobj = basis)
plot(Klist$FPC_list[[1]])
plot(Klist$FPC_list[[2]])
# }
Run the code above in your browser using DataLab