code: def _compute_u(K):
      
      M = K.shape[0] - 1
      # Compute right and left eigenvectors:
      l, U = scl.eig(K.T)
      l, U = sort_by_norm(l, U)
      # Extract the eigenvector for eigenvalue one and normalize:
      u = np.real(U[:, 0])
      v = np.zeros(M+1)
      v[M] = 1.0
      u = u / np.dot(u, v)
      return u
docs: Estimate an approximation of the ratio of stationary over empirical distribution from the basis.
      Parameters:
      -----------
      K0, ndarray(M+1, M+1),
          time-lagged correlation matrix for the whitened and padded data set.
      Returns:
      --------
      u : ndarray(M,)
          coefficients of the ratio stationary / empirical dist. from the whitened and expanded basis.