I would like to calculate the Covariance matrix of two distributions, what could be the possible ways to calculate them in python?
Asked
Active
Viewed 1,040 times
1 Answers
6
You should use numpy.
>>> from numpy import cov
>>> cov([1, 2, 3], [2, 12, 14])
array([[ 1. , 6. ],
[ 6. , 41.33333333]])

Glorfindel
- 21,988
- 13
- 81
- 109

David Robinson
- 77,383
- 16
- 167
- 187