def compute_Obj(Y, A, K): # main objective
    """ sum_{j=2}^K of (Y_{:,j})^TA(Y_{:,j}) / ((Y_{:,j})^T(Y_{:,j})) """
    num, de = 0, 0
    for i in range(K-1):
        num += (Y[:,i+1].T).dot(A.dot(Y[:,i+1]))
        de += Y[:,i+1].T@Y[:,i+1]
    return (num / de)