用 Python 计算两个分布的协方差矩阵

问题描述 投票:0回答:1

我想计算两个分布的协方差矩阵,用 python 计算它们的可能方法是什么?

python statistics standard-deviation deviation
1个回答
6
投票

你应该使用 numpy.

>>> from numpy import cov
>>> cov([1, 2, 3], [2, 12, 14])
array([[  1.        ,   6.        ],
       [  6.        ,  41.33333333]])
© www.soinside.com 2019 - 2024. All rights reserved.