do.ica
is an R implementation of FastICA algorithm, which aims at
finding weight vectors that maximize a measure of non-Gaussianity of projected data.
FastICA is initiated with pre-whitening of the data. Single and multiple component
extraction are both supported. For more detailed information on ICA and FastICA algorithm,
see this Wikipedia page.
do.ica(
X,
ndim = 2,
type = "logcosh",
tpar = 1,
sym = FALSE,
tol = 1e-06,
redundancy = TRUE,
maxiter = 100
)
an
an integer-valued target dimension.
nonquadratic function, one of "logcosh"
,"exp"
, or "poly"
be chosen.
a numeric parameter for logcosh
and exp
parameters that should be close to 1.
a logical value; FALSE
for not using symmetric decorrelation, TRUE
otherwise.
stopping criterion for iterative update.
a logical value; TRUE
for removing NA
values after prewhitening, FALSE
otherwise.
maximum number of iterations allowed.
an
a list containing information for out-of-sample prediction.
a
In most of ICA literature, we have projection
for unmixing matrix
hyvarinen_independent_2001Rdimtools
# NOT RUN {
## use iris dataset
data(iris)
set.seed(100)
subid = sample(1:150,50)
X = as.matrix(iris[subid,1:4])
lab = as.factor(iris[subid,5])
## 1. use logcosh function for transformation
output1 <- do.ica(X,ndim=2,type="logcosh")
## 2. use exponential function for transformation
output2 <- do.ica(X,ndim=2,type="exp")
## 3. use polynomial function for transformation
output3 <- do.ica(X,ndim=2,type="poly")
## Visualize three different projections
opar <- par(no.readonly=TRUE)
par(mfrow=c(1,3))
plot(output1$Y, col=lab, pch=19, main="ICA::logcosh")
plot(output2$Y, col=lab, pch=19, main="ICA::exp")
plot(output3$Y, col=lab, pch=19, main="ICA::poly")
par(opar)
# }
Run the code above in your browser using DataLab