pspline.kffobi {pfica}R Documentation

P-Spline smoothed functional PCA/ICA

Description

This function is an alternative way of computing the smoothed functional ICA in terms of principal components (see kffobi). The function further provides smoothed (and non-smoothed) functional PCA estimates. A discrete penalty that measures the roughness of principal factors by summing squared r-order differences between adjacent B-spline coefficients (P-spline penalty) is used; see Aguilera and Aguilera-Morillo (2013) and Eliers and Marx (2021).

Usage

pspline.kffobi(fdx, ncomp = fdx$basis$nbasis, pp = 0, r = 2,
               w = c("PCA", "PCA-cor","ZCA", "ZCA-cor","Cholesky"),
               pr = c("fdx", "wfdx", "KL", "wKL"),
               center = TRUE)

Arguments

fdx

a functional data object obtained from the fda package.

ncomp

number of independent components to compute (must be > 1).

pp

the penalty parameter. It can be estimated using leave-one-out cross-validation.

r

a number indicating the order of the penalty.

w

the whitening procedure. By default ZCA (Mahalanobis whitening) is used.

pr

the functional data object to project on to the space spanned by the eigenfunctions of the kurtosis kernel function. To compute the independent components, the usual procedure is to use wKL, the whitened principal component expansion. If pr is not supplied, then wKL is used. Note that w stands for whitened, e.g., wfdx is the whitened original data.

center

a logical value indicating whether the mean function has to be subtracted from each functional observation.

Value

a list with the following named entries:

PCA.eigv

a numeric vector giving the eigenvalues of the covariance kernel function.

PCA.basis

a functional data object for the eigenfunctions of the covariance kernel function.

PCA.scores

a matrix whose column vectors are the principal components.

ICA.eigv

a numeric vector giving the eigenvalues of the kurtosis kernel function.

ICA.eigv

a numeric vector giving the eigenvalues of the kurtosis kernel function.

ICA.scores

a matrix whose column vectors are the projection coefficients for fdx, wfdx, KL or wKL.

wKL

the whitened principal components expansion whith coefficients in terms of basis functions.

Author(s)

Marc Vidal, Ana Mª Aguilera

References

Aguilera, A.M. and M.C. Aguilera-Morillo (2013). Penalized PCA approaches for B-spline expansions of smooth functional data. Applied Mathematics and Computation 219(14), 7805–7819, <doi:10.1016/j.amc.2013.02.009>.

Eilers, P. and B. Marx (2021). Practical Smoothing: The Joys of P-splines. Cambridge: Cambridge University Press, <doi:10.1017/9781108610247>.

Vidal, M., M. Rosso and A.M. Aguilera. (2021). Bi-Smoothed Functional Independent Component Analysis for EEG Artifact Removal. Mathematics 9(11), 1243, <doi:10.3390/math9111243>.

See Also

kffobi, whiten.fd

Examples

## Canadian Weather data
library(fda)
arg <- 1:365
Temp <- CanadianWeather$dailyAv[,,1]
B <- create.bspline.basis(rangeval=c(min(arg),max(arg)), nbasis=14)
x <- Data2fd(Temp, argvals = arg, B)
#plot(x) #plot data
ica.fd <- pspline.kffobi(x, 2, pp = 10^4, w="ZCA-cor")

## Whitened data using the two first smoothed principal components
wKL <- ica.fd$wKL

## Plot by region
sc <- ica.fd$ICA.scores
plot(sc[,2], sc[,1], pch = 20, col = factor(CanadianWeather$region),
     ylab = "IC 1", xlab = "IC 2")

[Package pfica version 0.1.3 Index]