A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/thebrisklab/SparseICA below:

GitHub - thebrisklab/SparseICA

SparseICA: Sparse Independent Component Analysis

Sparse ICA (Sparse Independent Component Analysis) is a novel ICA method that enables sparse estimation of independent source components.

We assume you are running R 4.1.0 or newer. There is no guarantee for backward or forward comparability. Please raise the issue on GitHub if something breaks.

The following R packages are required:

You can install them by running this code:

if(!require(c("Rcpp","RcppArmadillo","MASS","irlba","clue","ciftiTools","parallel","devtools"))){
    install.packages(c("Rcpp","RcppArmadillo","MASS","irlba","clue","ciftiTools","parallel","devtools"))
}

Then you can install Sparse ICA from github with:

library(devtools)
install_github("thebrisklab/SparseICA")
# Load the package
library(SparseICA)

The sparseICA() is the main function of our Sparse ICA algorithm. It is implemented in both pure R and Rcpp.

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
)

The output will be a list with the following components as such:

Load the example data:

1. Visualization of example data
par(mfrow=c(1,3))
image(matrix(-example_sim123$smat[,1],33))
image(matrix(-example_sim123$smat[,2],33))
image(matrix(-example_sim123$smat[,3],33))

par(mfrow=c(3,1))
plot(example_sim123$mmat[1,],type = "l",xlab = "Time",ylab = "")
plot(example_sim123$mmat[2,],type = "l",xlab = "Time",ylab = "")
plot(example_sim123$mmat[3,],type = "l",xlab = "Time",ylab = "")

par(mfrow=c(1,3))
image(matrix(example_sim123$xmat[,12],33))
image(matrix(example_sim123$xmat[,23],33))
image(matrix(example_sim123$xmat[,35],33))

my_sparseICA = sparseICA(xData = example_sim123$xmat, n.comp = 3, nu = "BIC", method = "C",restarts = 40,
                           eps = 1e-6, maxit = 500, verbose=TRUE)

The selected optimal nu is 1.1.

3. Visualization of Sparse ICA results
matched_res=matchICA(my_sparseICA$estS,example_sim123$smat,my_sparseICA$estM)
par(mfrow=c(1,3))
image(matrix(-matched_res$S[,1],33,33))
image(matrix(-matched_res$S[,2],33,33))
image(matrix(-matched_res$S[,3],33,33))

par(mfrow=c(3,1))
plot(matched_res$M[1,],type = "l",xlab = "Time",ylab = "")
plot(matched_res$M[2,],type = "l",xlab = "Time",ylab = "")
plot(matched_res$M[3,],type = "l",xlab = "Time",ylab = "")

> cor(example_sim123$smat[,1],matched_res$S[,1])
[1] 0.9970362
> cor(example_sim123$smat[,2],matched_res$S[,2])
[1] 0.9962684
> cor(example_sim123$smat[,3],matched_res$S[,3])
[1] 0.9856885

> cor(example_sim123$mmat[1,],matched_res$M[1,])
[1] 0.964416
> cor(example_sim123$mmat[2,],matched_res$M[2,])
[1] 0.9910054
> cor(example_sim123$mmat[3,],matched_res$M[3,])
[1] 0.9922269

Those using the SparseICA software should cite:
Wang Z., Gaynanova, I., Aravkin, A., Risk, B. B. (2024). Sparse Independent Component Analysis with an Application to Cortical Surface fMRI Data in Autism. Journal of the American Statistical Association, 119(548), 2508-2520.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4