爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 6694|回复: 1

[讨论] matlab的相关系数计算函数corr中'rows’选项的疑问

[复制链接]

新浪微博达人勋

发表于 2013-12-6 10:59:19 | 显示全部楼层 |阅读模式

登录后查看更多精彩内容~

您需要 登录 才可以下载或查看,没有帐号?立即注册 新浪微博登陆

x
题目说的不清楚。先把help文档贴上来:
corr Linear or rank correlation.
    RHO = corr(X) returns a P-by-P matrix containing the pairwise linear
    correlation coefficient between each pair of columns in the N-by-P
    matrix X.

    RHO = corr(X,Y,...) returns a P1-by-P2 matrix containing the pairwise
    correlation coefficient between each pair of columns in the N-by-P1 and
    N-by-P2 matrices X and Y.

    [RHO,PVAL] = corr(...) also returns PVAL, a matrix of p-values for
    testing the hypothesis of no correlation against the alternative that
    there is a non-zero correlation.  Each element of PVAL is the p-value
    for the corresponding element of RHO.  If PVAL(i,j) is small, say less
    than 0.05, then the correlation RHO(i,j) is significantly different
    from zero.

    [...] = corr(...,'PARAM1',VAL1,'PARAM2',VAL2,...) specifies additional
    parameters and their values.  Valid parameters are the following:

         Parameter  Value
          'type'    'Pearson' (the default) to compute Pearson's linear
                    correlation coefficient, 'Kendall' to compute Kendall's
                    tau, or 'Spearman' to compute Spearman's rho.
          'rows'    'all' (default) to use all rows regardless of missing
                    values (NaNs), 'complete' to use only rows with no
                    missing values, or 'pairwise' to compute RHO(i,j) using
                    rows with no missing values in column i or j.
          'tail'    The alternative hypothesis against which to compute
                    p-values for testing the hypothesis of no correlation.
                    Choices are:
                       TAIL         Alternative Hypothesis
                    ---------------------------------------------------
                      'both'     correlation is not zero (the default)
                      'right'    correlation is greater than zero
                      'left'     correlation is less than zero

    The 'pairwise' option for the 'rows' parameter can produce RHO that is not
    positive definite.  The 'complete' option always produces a positive
    definite RHO, but when data are missing, the estimates may be based on
    fewer observations.

看这个文档中‘rows’选项的介绍,分不清pairwise和complete的区别。最后好像提到他们的区别是最终那个相关系数矩阵是不是正定的。我不懂这个到底代表着什么含义,“正定”或者“不正定”有什么差别,pairwise和complete两个选项具体执行过程是怎样的,有什么差别。
谢谢大家了!
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2013-12-6 11:09:52 | 显示全部楼层
matlab的相关系数计算函数corr中'rows’选项的疑问
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册 新浪微博登陆

本版积分规则

Copyright ©2011-2014 bbs.06climate.com All Rights Reserved.  Powered by Discuz! (京ICP-10201084)

本站信息均由会员发表,不代表气象家园立场,禁止在本站发表与国家法律相抵触言论

快速回复 返回顶部 返回列表