canonical_correlation_analysis: Canonical correlation analysis

Description Usage Arguments Value Examples

Description

Canonical correlation analysis (CCA) finds pairs of vectors (w,v) such that projections Xw and Yv have maximal possible correlations. The pairs are ordered in decreasing order of the correlations. In addition, projection vectors are normalized such that the variance of Xw and of Yv is equal to 1. This means that projections are not only correlated, but "on the same scale" and hence can be directly compared.

Usage

1
canonical_correlation_analysis(x, y, epsilon = 1e-04)

Arguments

x

Matrix of size n-by-p with n observations from p variables. Alternatively, data frames and numeric vectors are supported and automatically converted.

y

Matrix of size n-by-p with n observations from p variables. Alternatively, data frames and numeric vectors are supported and automatically converted.

epsilon

Numeric value usued as tolerance threshold for rank reduction of the input matrices. Default is 1e-4.

Value

A list containing the following components

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
library(MASS)
library(pracma)

X <- mvrnorm(1000, mu = c(0, 0), Sigma = eye(2))
cca <- canonical_correlation_analysis(X, X)
cca

X <- mvrnorm(1000, mu = c(1, 2),
             Sigma = matrix(c(1.5, 0.5, 0.5, 1.5), ncol = 2))
cca <- canonical_correlation_analysis(X, X)
cca

jandob/ccf documentation built on May 18, 2019, 12:23 p.m.