KFPCA_reg: Kendall Functional Principal Component Analysis (KFPCA) for...

Description Usage Arguments Value References Examples

View source: R/KFPCA_reg.R

Description

KFPCA for non-Gaussian functional data with dense and regular design.

Usage

1
KFPCA_reg(Lt, Ly, nGrid, nK, fdParobj)

Arguments

Lt

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.

Ly

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.

nGrid

An integer denoting the number of observation time for each subject.

nK

An integer denoting the number of FPCs.

fdParobj

A functional parameter object for the smoothing of mean function and eigenfunctions. For more detail, see smooth.basis.

Value

A list containing the following components:

meanfd

A functional data object for the mean function estimates.

FPC_list

A list containing nK functional data objects, which are the eigenfunction estimates.

score

A n by nK matrix containing the estimates of the FPC scores, where n is the sample size.

CompTime

A scalar denoting the computation time.

References

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>.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
# 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]])

KFPCA documentation built on Feb. 4, 2022, 5:07 p.m.

Related to KFPCA_reg in KFPCA...