code: def scale_K(K, verbose=False,trace_method=True):
      
      if trace_method:
          scalar=1.0/(K.diagonal().mean())
      else:
          c = SP.sum((SP.eye(len(K)) - (1.0 / len(K)) * SP.ones(K.shape)) * SP.array(K))
          scalar = (len(K) - 1) / c
      if verbose:
          print(('Kinship scaled by: %0.4f' % scalar))
      K = K * scalar
      return K
docs: scale covariance K such that it explains unit variance
      trace_method: standardize to unit trace (deafault: True)