public void updateWidth(){
  if (m_SumOfWeights > 0) {
    double mean=m_WeightedSum / m_SumOfWeights;
    double variance=m_WeightedSumSquared / m_SumOfWeights - mean * mean;
    if (variance < 0) {
      variance=0;
    }
    m_Width=Math.sqrt(variance) * Math.pow(m_SumOfWeights,m_Exponent);
    if (m_Width <= m_MinWidth) {
      m_Width=m_MinWidth;
    }
  }
 else {
    m_Width=Double.MAX_VALUE;
  }
}

public void updateWidth ( ) { if ( m_SumOfWeights > 0 ) { double mean = m_WeightedSum / m_SumOfWeights ; double variance = m_WeightedSumSquared / m_SumOfWeights - mean * mean ; if ( variance < 0 ) { variance = 0 ; } m_Width = Math . sqrt ( variance ) * Math . pow ( m_SumOfWeights , m_Exponent ) ; if ( m_Width <= m_MinWidth ) { m_Width = m_MinWidth ; } } else { m_Width = Double . MAX_VALUE ; } }
updates bandwidth : the sample standard deviation is multiplied by the total weight to the power of the given exponent . if the total weight is not greater than zero , the width is set to double . max_value . if that is not the case , but the width becomes smaller than m_minwidth , the width is set to the value of m_minwidth .
