function [ystar,cvout,cm]=transformH2x(Y,sigma,res)
T=rows(Y);
N=cols(res);

s12=sigma(1:N,N+1:end);
s11=sigma(1:N,1:N);
s22=sigma(N+1:end,N+1:end);
is11=invpd(s11);
cm=res*is11*s12;
cv=s22-s12'*is11*s12;


ystar=Y-cm;
cvout=cv;


