Learn R Programming

pfica (version 0.1.2)

pspline.kffobi: P-Spline smoothed functional ICA

Description

This function provides an alternative form of computing the smoothed functional ICA in terms of principal components (function kffobi). 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) for a detailed discussion.

Usage

pspline.kffobi(fdx, ncomp = fdx$basis$nbasis, pp = 0, r = 2,
               pr = c("fdx", "fdx.st", "KL", "KL.st"),
               shrinkage = FALSE, center = FALSE, plotfd = FALSE)

Value

a list with the following named entries:

PCA.eigv

a numeric vector giving the eigenvalues of the covariance operator.

PCA.basis

a functional data object for the eigenfunctions of the covariance operator.

PCA.scores

a matrix whose column vectors are the principal components.

ICA.eigv

a numeric vector giving the eigenvalues of the kurtosis operator.

ICA.basis

a functional data object for the eigenfunctions of the covariance operator.

ICA.scores

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

ICA.kurtosis

a numeric vector giving the kurtosis of each component vector.

Arguments

fdx

a functional data object obtained from the fda package.

ncomp

number of independent components to compute.

pp

the penalty parameter. It can be estimated by leave-one-out cross-validation or baseline cross-validation (see bcv).

r

a number indicating the order of the penalty.

pr

the functional data object to project into the space spanned by the eigenfunctions of the kurtosis operator. To compute the independent components, the usual procedure is to use KL.st, the standardized principal component expansion. Thus, if pr is not supplied, then KL.st is used.

shrinkage

uses shrinkage estimators to compute the covariance matrix of the coordinate vectors.

center

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

plotfd

a logical value indicating whether to plot the eigenfunctions
of the kurtosis operator.

Author

Marc Vidal, Ana Mª Aguilera

Details

To compute the penalty matrix, the following code is used: \(\Delta^{2}=\mathtt{diff(diag(nknots+2), differences = 2)}\), where nknots is the number of basis knots. As in kffobi, the functional ICA of the principal component expansion is equivalent to the multivariate ICA of the principal coordinate vectors; see Details in kffobi.

References

Aguilera, AM. and MC. Aguilera-Morillo (2013). “Penalized PCA approaches for B-spline expansions of smooth functional data”. In: Applied Mathematics and Computation 219(14), pp. 7805–7819.

Vidal, M., M. Rosso and AM. Aguilera. (2021). Bi-Smoothed Functional Independent Component Analysis for EEG Artifact Removal. Mathematics 9(11) 1243.

See Also

kffobi

Examples

Run this code
## Canadian Weather data
library(fda)
arg <- 1:365
Temp <- CanadianWeather$dailyAv[,,1]
B <- create.bspline.basis(rangeval=c(min(arg),max(arg)), nbasis=16)
x <- Data2fd(Temp, argvals = arg, B)
ica.fd <- pspline.kffobi(x, 16, pp = 10)
## Plot by region in order of maximum kurtosis (outliers)
sc <- ica.fd$ICA.scores
plot(sc[,1], sc[,2], ylab = "", xlab = "")
text(sc[,1], sc[,2], CanadianWeather$region, pch=0.5, cex=0.6)

Run the code above in your browser using DataLab