作业帮 > 综合 > 作业

话说matlab 中spear函数可以求出两个向量或矩阵的spearman 相关系数,但是数理统计工具箱中并没有这个函数

来源:学生作业帮 编辑:灵鹊做题网作业帮 分类:综合作业 时间:2024/04/30 06:19:15
话说matlab 中spear函数可以求出两个向量或矩阵的spearman 相关系数,但是数理统计工具箱中并没有这个函数啊.能不能把这个函数的定义或者工具箱中此函数的代码贴出来,
话说matlab 中spear函数可以求出两个向量或矩阵的spearman 相关系数,但是数理统计工具箱中并没有这个函数
的确没有spear函数,我们是用corr来计算的:
[RHO,PVAL] = corr(X,Y,'name',value)
其中name可以是type,rows,tail,而value分别如下:
type:'Pearson' (the default) computes Pearson's linear correlation coefficient
'Kendall' computes Kendall's tau
'Spearman' computes Spearman's rho
rows 'all' (the default) uses all rows regardless of missing values (NaNs)
'complete' uses only rows with no missing values
'pairwise'computes RHO(i,j) using rows with no missing values in column i or j
tail 'both' — Correlation is not zero (the default)
'right' — Correlation is greater than zero
'left' — Correlation is less than zero