gemmr.generative_model._find_latent_mode_vectors_opti

gemmr.generative_model._find_latent_mode_vectors_opti(Sigmaxx, Sigmayy, U, V, assemble_Sigmaxy, expl_var_ratio_thr, m, max_n_sigma_trials, qx, qy, rng, true_corrs, verbose)

Find latent mode vectors using an optimization algorithm that maximizes the minimum eigenvalue of the proposed joint covariance matrix.

The minimum eigenvalue is monitored during optimization and as soon as it is positive, optimization is stopped.

Parameters:
  • Sigmaxx (np.ndarray (px, px)) – within-set covariance matrix for X
  • Sigmayy (np.ndarray (py, py)) – within-set covariance matrix for Y
  • U (np.ndarray (px, m)) – weight vectors for X
  • V (np.ndarray (py, m)) – weight vectors for Y
  • assemble_Sigmaxy (function) – either _assemble_Sigmaxy_pls or _assemble_Sigmaxy_cca
  • expl_var_ratio_thr (float) – the ratio of the amount of variance along the first mode vectors in X and Y to the mean variance along a mode in X and Y needs to surpass this number.
  • m (int >= 1) – number of cross-modality modes to be encoded
  • max_n_sigma_trials (int) – maximum number of attempts made to find a linear combination of dominant and low-variance subspace components for the weight vectors such that both enough variance is explained and the resulting joint covariance matrix \(\Sigma\) is positive definite
  • qx (int) – dimensionality of dominant subspace for X
  • qy (int) – dimensionality of dominant subspace for Y
  • rng (random number generator instance) – for reproducibility, all random numbers will be drawn from this generator
  • true_corrs (np.ndarray (m,)) – true correlation of between-set association modes
  • verbose (bool) – whether to print status messages
Returns:

  • Sigmaxy (np.ndarray (px, py)) – between-set covariance matrix
  • Sigmaxy_svals (np.ndarray (m,)) – singular values of Sigmaxy, these are the true canonical correlations or covariances (for CCA or PLS, respectively)
  • U_ (np.ndarray (px, m)) – between-set weight vectors
  • V_ (np.ndarray (py, m)) – between-set weight vectors
  • latent_expl_var_ratios_x (np.ndarray (m,)) – explained variance ratios for between-set weight vectors in set X
  • latent_expl_var_ratios_y (np.ndarray (m,)) – explained variance ratios for between-set weight vectors in set Y
  • min_eval (float) – smallest eigenvalue of Schur complement of joint covariance matrix \(\Sigma\). \(\Sigma\) is positive definite if and only if min_eval > 0
  • true_corrs (np.ndarray (m,)) – true correlations of between-set association modes
  • latent_mode_vector_algo (str) – identifies the algorithm: is set to 'opti'