I know that numpy.cov
calculates the covariance given a N dimensional array.
I can see from the documentation on GitHub that the normalisation is done by (N-1)
. But for my specific case, the covariance matrix is given by:
where xi
is the quantity. i
and j
are the bins.
As you can see from the above equation, this covariance matrix is normalised by (N-1)/N
.
TO GET THE ABOVE NORMALISATION
Can I simply multiply the covariance matrix obtained from numpy.cov
by (N-1)**2 / N
to get the above normalisation? Is that correct?
Or Should I use the bias
parameter inside numpy.cov
? If so how?
There are two ways of doing this.
np.cov
with bias=1
and then multiply the result by N-1
or
(N-1)**2/N