def rotateCovMat( Sigma, theta=np.pi/4):
  RotMat = [[np.cos(theta), -np.sin(theta)], [np.sin(theta), np.cos(theta)]]
  RotMat = np.asarray( RotMat)
  Lam,V = np.linalg.eig( Sigma )
  Lam = np.diag(Lam)
  Vrot = np.dot( V, RotMat )
  return np.dot( Vrot, np.dot( Lam, Vrot.T) )
Returns valid covariance matrix with same eigen structure, rotated by theta radians
dataset/ETHPy150Open daeilkim/refinery/refinery/bnpy/bnpy-dev/bnpy/util/RandUtil.py/rotateCovMat