shearman相关系数和pearson相关系数 MATLAB代码实现

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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代码实现的主要内容,如果未能解决你的问题,请参考以下文章

初学python,怎样用python做pearson相关系数的检验呢,求指导啊

SPSS中pearson(皮尔逊相关系数)看r值还是P值,确定相关性

相关性Correlations 皮尔逊相关系数(pearson)和斯皮尔曼等级相关系数(spearman)

pearson相关系数检验怎样看是不是具有多重共线性

如何理解皮尔逊相关系数

相关系数之皮尔逊pearson相关系数和斯皮尔曼spearman等级相关系数(评价线性关系的相关系数)