3 %>@brief Canonical Correlation Analysis
6 %> Hastie et. al. 2001, The elements of statistical learning, exercise 3.18.
10 %> @param P either the penalty coefficients of a penalty matrix itself
12 function [A, B] =
cca(X, Y, P)
21 % assumes the coefficients have been passed
28 Y = data_normalize(Y, 's');
29 X = data_normalize(X, 's'); % We need this otherwise the correlation X'*Y needs normalization
33 [A, B] = canoncorr(X, Y);
35 % Hastie et. al. 2001, The elements of statistical learning, exercise
38 % This algorithm is working fine
40 p = min(size(X, 2), size(Y, 2))-1;
42 M = (Y'*Y)^(-1/2)*(Y'*X)*(X'*X+P)^(-1/2);
45 B = (Y'*Y)^(-1/2)*U(:, 1:p);
46 A = (X'*X+P)^(-1/2)*V(:, 1:p);
function penalty_matrix(in nf, in dcoeff)
function cca(in X, in Y, in P)