code: def leverages(self, block='X'):
          
          # TODO check with matlab and simca
          try:
              if block == 'X':
                  return np.dot(self.scores_t, np.dot(np.linalg.inv(np.dot(self.scores_t.T, self.scores_t), self.scores_t.T)))
              elif block == 'Y':
                  return np.dot(self.scores_u, np.dot(np.linalg.inv(np.dot(self.scores_u.T, self.scores_u), self.scores_u.T)))
              else:
                  raise ValueError
          except ValueError as verr:
              raise ValueError('block option must be either X or Y')
docs: Calculate the leverages for each observation
          :return:
          :rtype: