diff --git a/fluents/lib/cx_stats.py b/fluents/lib/cx_stats.py index 078df5f..2ff65fc 100644 --- a/fluents/lib/cx_stats.py +++ b/fluents/lib/cx_stats.py @@ -96,10 +96,11 @@ def procrustes(A, B, strict=True, center=False, verbose=False): else: return b_rot -def expl_var_x(X, T): - """Returns explained variance of X.""" - # centered X,Y - exp_var_x = diag(dot(T.T, T))*100/(sum(X**2)) +def expl_var_x(Xc, T): + """Returns explained variance of X. + T should carry variance in length, Xc has zero col-mean. + """ + exp_var_x = diag(dot(T.T, T))*100/(sum(Xc**2)) return exp_var_x def expl_var_y(Y, T, Q): @@ -139,26 +140,28 @@ def pls_qvals(a, b, aopt=None, alpha=.3, n_false = zeros((n, n_iter), dtype='