%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Correlation Corr=corr(Rets,'type','Spearman'); xlswrite('Corr.xls',Corr) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Distance A=Rets'; Y=pdist(A,'spearman'); Dist=squareform(Y); Z=linkage(Y); S=sparse(Dist); W=graphminspantree(S); [T,eigvals]=cmdscale(Dist); Coords(:,1)=T(:,1); Coords(:,2)=T(:,2); Coords(:,3)=T(:,3); xlswrite('eigvals.xls',eigvals) xlswrite('Dist.xls',Dist) xlswrite('MST.xls',W) xlswrite('Coords.xls',Coords) scatter(Coords(:,1),Coords(:,2)) scatter3(Coords(:,1),Coords(:,2),Coords(:,3)) [M N]=size(Dist); Thr=0.3; for i=1:M for j=1:N if Dist(i,j)>Thr Kappa(i,j)=0; else Kappa(i,j)=1; end end end k=1; for i=1:M for j=1:N if i