views:

20

answers:

1

I am using Weka to claclculate the probability for a given dataset. More specifically I am using the KernelEstimator class. For good density estimation results the choice of the bandwith parameter is crutial, but i have not been able to find out how the bandwith parameter is calculated. The kernel function being used is a simple Gaussian Kernel. Does anyone know how the bandwith parameter is calculated?

A: 

You can find it here:

There you will find

m_SumOfWeights += weight;
double range = m_Values[m_NumValues - 1] - m_Values[0];
if (range > 0) {
  m_StandardDev = Math.max(range / Math.sqrt(m_SumOfWeights), 
      // allow at most 3 sds within one interval
      m_Precision / (2 * 3));
}

m_StandardDev is what it uses later on as the "variance" of the Gaussian kernels, i.e., your bandwidth.

datanalytics.com