sparseICA | R Documentation |
This function performs Sparse Independent Component Analysis (Sparse ICA), implemented in both pure R and RCpp for efficiency.
sparseICA(
xData,
n.comp,
nu = "BIC",
nu_list = seq(0.1, 4, 0.1),
U.list = NULL,
whiten = c("eigenvec", "sqrtprec", "none"),
lngca = FALSE,
orth.method = c("svd", "givens"),
method = c("C", "R"),
restarts = 40,
use_irlba = TRUE,
eps = 1e-06,
maxit = 500,
verbose = TRUE,
BIC_verbose = FALSE,
converge_plot = FALSE,
col.stand = TRUE,
row.stand = FALSE,
iter.stand = 5,
positive_skewness = TRUE
)
xData |
A numeric matrix of input data with dimensions P x T, where P is the number of features and T is the number of samples. |
n.comp |
An integer specifying the number of components to estimate. |
nu |
A positive numeric value or a character "BIC" specifying the tuning parameter controlling the balance between accuracy and sparsity of the results. It can be selected using a BIC-like criterion ( |
nu_list |
A numeric vector specifying the list of candidate tuning parameters. Default is |
U.list |
An optional matrix specifying the initialization of the U matrix. Default is |
whiten |
A character string specifying the method for whitening the input |
lngca |
A logical value indicating whether to perform Linear Non-Gaussian Component Analysis (LNGCA). Default is |
orth.method |
A character string specifying the method used for generating initial values for the U matrix. Default is |
method |
A character string specifying the computation method. If |
restarts |
An integer specifying the number of random initializations for optimization. Default is 40. |
use_irlba |
A logical value indicating whether to use the |
eps |
A numeric value specifying the convergence threshold. Default is |
maxit |
An integer specifying the maximum number of iterations for the Sparse ICA method using Laplace density. Default is 500. |
verbose |
A logical value indicating whether to print convergence information during execution. Default is |
BIC_verbose |
A logical value indicating whether to print BIC selection information. Default is |
converge_plot |
A logical value indicating whether to generate a line plot showing the convergence trace. Default is |
col.stand |
A logical value indicating whether to standardize columns. For each column, the mean of the entries in the column equals 0, and the variance of the entries in the column equals 1. Default is |
row.stand |
A logical value indicating whether to standardize rows. For each row, the mean of the entries in the row equals 0, and the variance of the entries in the row equals 1. Default is |
iter.stand |
An integer specifying the number of iterations for achieving both row and column standardization when |
positive_skewness |
A logical value indicating whether to enforce positive skewness on the estimated components. Default is |
A list containing the following elements:
loglik
The minimal log-likelihood value among the random initializations.
estS
A numeric matrix of estimated sparse independent components with dimensions P x Q.
estM
The estimated mixing matrix with dimensions Q x T.
estU
The estimated U matrix with dimensions Q x Q.
whitener
The whitener matrix used for data whitening.
converge
The trace of convergence for the U matrix.
BIC
A numeric vector of BIC values corresponding to each candidate nu
in nu_list
.
nu_list
A numeric vector of candidate tuning parameter values.
best_nu
The optimal nu
selected based on the BIC-like criterion.
#get simulated data
data(example_sim123)
my_sparseICA <- sparseICA(xData = example_sim123$xmat, n.comp = 3, nu = "BIC", method="C",
restarts = 40, eps = 1e-6, maxit = 500, verbose=TRUE)
res_matched <- matchICA(my_sparseICA$estS,example_sim123$smat)
# Visualize the estimated components
oldpar <- par()$mfrow
par(mfrow=c(1,3))
image(matrix(res_matched[,1],33,33))
image(matrix(res_matched[,2],33,33))
image(matrix(res_matched[,3],33,33))
par(mfrow=oldpar)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.