def _statsmodels_univariate_kde(data, kernel, bw, gridsize, cut, clip, cumulative=False):
 fft = (kernel == 'gau')
 kde = smnp.KDEUnivariate(data)
 kde.fit(kernel, bw, fft, gridsize=gridsize, cut=cut, clip=clip)
 if cumulative:
  (grid, y) = (kde.support, kde.cdf)
 else:
  (grid, y) = (kde.support, kde.density)
 return (grid, y)

def _statsmodels_univariate_kde ( data , kernel , bw , gridsize , cut , clip , cumulative = False ) : fft = ( kernel == 'gau' ) kde = smnp . KDEUnivariate ( data ) kde . fit ( kernel , bw , fft , gridsize = gridsize , cut = cut , clip = clip ) if cumulative : ( grid , y ) = ( kde . support , kde . cdf ) else : ( grid , y ) = ( kde . support , kde . density ) return ( grid , y )
compute a univariate kernel density estimate using statsmodels .