首页 > 代码库 > shearman相关系数和pearson相关系数 MATLAB代码实现
shearman相关系数和pearson相关系数 MATLAB代码实现
SLNum=iris(:,1);
SWNum=iris(:,2);
PLNum=iris(:,3);
PWNum=iris(:,4);
Num=[SLNum,SWNum,PLNum,PWNum];
coeff1=corr(SLNum,SWNum,‘type‘,‘Spearman‘);
coeff2=corr(SLNum,PLNum,‘type‘,‘Spearman‘);
coeff3=corr(SLNum,PWNum,‘type‘,‘Spearman‘);
coeff4=corr(SWNum,PLNum,‘type‘,‘Spearman‘);
coeff5=corr(SWNum,PWNum,‘type‘,‘Spearman‘);
coeff6=corr(PLNum,PWNum,‘type‘,‘Spearman‘);
D=[0,coeff1,coeff2,coeff3;coeff1,0,coeff4,coeff5;coeff2,coeff4,0,coeff6;coeff3,coeff5,coeff6,0];
coeffp1=corr(SLNum,SWNum,‘type‘,‘Pearson‘);
coeffp2=corr(SLNum,PLNum,‘type‘,‘Pearson‘);
coeffp3=corr(SLNum,PWNum,‘type‘,‘Pearson‘);
coeffp4=corr(SWNum,PLNum,‘type‘,‘Pearson‘);
coeffp5=corr(SWNum,PWNum,‘type‘,‘Pearson‘);
coeffp6=corr(PLNum,PWNum,‘type‘,‘Pearson‘);
Dp=[0,coeffp1,coeffp2,coeffp3;coeffp1,0,coeffp4,coeffp5;coeffp2,coeffp4,0,coeffp6;coeffp3,coeffp5,coeffp6,0];
D1=sum(D,2);
Dp1=sum(Dp,2);
I=(1./D1)‘;
J=(1./Dp1)‘;
SL=[0,0.9105*I(1),0,0,0.0797*I(1),0,0,1-I(1)+I(1)*0098];
SW=[0,0.8260*I(3),0,0,0,0.1561*I(2),0,1-I(2)+I(2)*0.0178];
PL=[0,1.0000*I(3),0,0,0.0000*I(3),0,0,1-I(3)+I(3)*0.0000];
PW=[0,1.0000*I(4),0,0,0.0000*I(4),0,0,1-I(4)+I(4)*0.0000];
m1=DS_fusion(SL,SW);
m2=DS_fusion(m1,PL);
m=DS_fusion(m2,PW);
SLp=[0,0.9105*J(1),0,0,0.0797*J(1),0,0,1-J(1)+J(1)*0098];
SWp=[0,0.8260*J(3),0,0,0,0.1561*J(2),0,1-J(2)+J(2)*0.0178];
PLp=[0,1.0000*J(3),0,0,0.0000*J(3),0,0,1-J(3)+J(3)*0.0000];
PWp=[0,1.0000*J(4),0,0,0.0000*J(4),0,0,1-J(4)+J(4)*0.0000];
m3=DS_fusion(SLp,SWp);
m4=DS_fusion(m3,PLp);
mp=DS_fusion(m4,PWp);
shearman相关系数和pearson相关系数 MATLAB代码实现