New function to compute BAMM correlation matrix (getCohortMatrix)