I generated a 2D gaussian distribution (uncorrelated datas)
dist2=np.array([np.random.normal(loc=10,scale=3, size=50000),np.random.normal(loc=5,scale=2, size=50000)])
I calculated the covariance matrix divided by bandwidth factor because the covariance attribute is The covariance matrix of dataset, scaled by the calculated bandwidth (kde.factor) (https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.gaussian_kde.html)
from scipy.stats import kde
# Use a kernel density estimator to produce local-counts in this space, and grid them to plot.
k = kde.gaussian_kde(dist2)
k.covariance/k.factor
Diagonal elements are not the square of the sigmas as expected.
I think there is something I have not understood on this bandwidth factor.
Any explanation would be appreciated. Thanks for help.