Skip to content

cran/multiCCA

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

multiCCA

multiCCA implements multiple canonical correlation analysis (MCCA) for multi-block data. The package provides tools for

  • kernel MCCA for repeated-measures data,
  • functional MCCA for functional observations,
  • automatic tuning of regularization parameters,
  • diagnostic tools based on the Hopkins statistic,
  • visualization of canonical components.

The implementation is designed for multi-view data integration, where multiple sets of features are observed for the same objects.

Installation

You can install the development version from GitHub:

# install.packages("pak")
pak::pak("Halmaris/multiCCA")

Example

Generate a simple multi-block dataset:

library(multiCCA)

set.seed(1)

n <- 20
T_len <- 10

X <- list(
  lapply(seq_len(n), function(i) matrix(rnorm(T_len * 3), T_len, 3)),
  lapply(seq_len(n), function(i) matrix(rnorm(T_len * 2), T_len, 2))
)

Fit kernel MCCA:

fit <- mcca_fit(
  method = "kernel",
  X = X,
  ncomp = 2
)

fit

Predict canonical component scores:

scores <- predict(fit, X)
head(scores[[1]])

Visualization

Plot canonical components for one block:

plot_mcca_scatter(fit)

Compare canonical components between blocks:

plot_mcca_pair(fit)

Model diagnostics

Evaluate clusterability of canonical representations using the Hopkins statistic:

H <- hopkins_vs_components(fit, max_comp = 2)

plot_hopkins_curve(H)

Author

Tomasz Górecki
Adam Mickiewicz University, Poznań

About

❗ This is a read-only mirror of the CRAN R package repository. multiCCA — Multiple Canonical Correlation Analysis (Kernel and Functional). Homepage: https://github.com/Halmaris/multiCCA Report bugs for this package: https://github.com/Halmaris/multiCCA/issues

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages