fns.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:pysptools 作者: ctherien 项目源码 文件源码
def cov(M):
    """
    Compute the sample covariance matrix of a 2D matrix.

    Parameters:
      M: `numpy array`
        2d matrix of HSI data (N x p)

    Returns: `numpy array`
        sample covariance matrix
    """
    N = M.shape[0]
    u = M.mean(axis=0)
    M = M - np.kron(np.ones((N, 1)), u)
    C = np.dot(M.T, M) / (N-1)
    return C
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号