I am trying to reconstruct data from the projections obtained with LDA. The idea would be to evaluate the reconstruction errors obtained from reduced sets of LDA factors. In the following matlab code, the question is how to obtain the reconstruction using the projected data p and the eigenvectors LTrans.
L = fitcdiscr(data,class);
[LTrans,Lambda] = eig(L.BetweenSigma,L.Sigma,'chol');
[Lambda,sorted] = sort(diag(Lambda),'descend'); % sort by eigenvalues
LTrans = LTrans(:,sorted);
xc = L.X;
mu = mean(xc);
Xm = bsxfun(@minus, xc, mu);
for i_fact=1:size(L.Sigma,2)
z = Xm*LTrans(:,1:i_fact);
p = z*LTrans(:,1:i_fact)';
p = bsxfun(@plus, p, mu);
end