0
$\begingroup$

I've been working with the scipy gaussian kde implementation (here), but I don't quite understand the difference between the bandwidth factor and the covariance matrix. I'm using it for a single dimension here, so the covariance matrix only contains a single value. The bandwidth factor is estimated using either Scott's or Silverman's method, and then apparently it is multiplied with the covariance matrix; but why? What does this covariance matrix actually represent? I understand the bandwidth is the 'width' of the kernel being used, but I don't see the role of the covariance matrix.

$\endgroup$

1 Answer 1

0
$\begingroup$

Scott's rule gives a bandwidth factor of $n^{- \frac{1}{d + 4}}$, where $n$ is the number of data points and $d$ their dimension; Silverman's is $(\frac14 n (d + 2))^{-\frac{1}{d + 4}}$.

Neither of these depend on the scale of the dataset. But if you change the scale of your data so that everything is 10 times as far apart, of course you should change the bandwidth of your KDE to be 10 times as large. That's accomplished by the covariance matrix, getting a sense of the scale of the overall data.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.