Plant Phenomics / 2020 / Article / Alg

Research Article

Hierarchical Canonical Correlation Analysis Reveals Phenotype, Genotype, and Geoclimate Associations in Plants

Algorithm 1.

Hierarchical canonical correlation analysis.
1: function HCCA(Xs = [X1,X2,...,XN])
2:  ifN = 1 then
3:   returnX1
4:  end if
5:  iarg = −1,jarg = −1,cmin = ∞
6:  fori = 1 ⟶ N − 1 do
7:   forj = i ⟶ Ndo
8:      c = κ(Xs[i]TXs[j])
9:      ifc < cminthen
10:       cmin = c,iarg = i,jarg = j
11:      end if
12:   end for
13:  end for
14:  Ui,j = CCA(Xs[iarg],Xs[jarg])
15:  Xs.remove(Xs[iarg])
16:  Xs.remove(Xs[jarg])
17:  Xs.add(Ui,j)
18:  return HCCA(Xs)
19: end function