class_docstr: Generic 1D Kernel object.
  Can be constructed by selecting a standard named Kernel,
  or providing a lambda expression and domain.
  The domain allows some algorithms to run faster for finite domain kernels.
class_docstr_tok: ["Generic","1D","Kernel","object",".","Can","be","constructed","by","selecting","a","standard","named","Kernel",",","or","providing","a","lambda","expression","and","domain",".","The","domain","allows","some","algorithms","to","run","faster","for","finite","domain","kernels","."]
docstr: Returns the kernel density estimate for point x based on x-values
  xs
code: def density(self, xs, x):
      """Returns the kernel density estimate for point x based on x-values
      xs
      """
      xs = np.asarray(xs)
      n = len(xs)  # before in_domain?
      if self.weights is not None:
          xs, weights = self.in_domain(xs, self.weights, x)
      else:
          xs = self.in_domain(xs, xs, x)[0]
      xs = np.asarray(xs)
      # print 'len(xs)', len(xs), x
      if xs.ndim == 1:
          xs = xs[:, None]
      if len(xs) > 0:
          h = self.h
          if self.weights is not None:
              w = 1 / h * np.sum(self((xs - x) / h).T * weights, axis=1)
          else:
              w = 1.0 / (h * n) * np.sum(self((xs - x) / h), axis=0)
          return w
      else:
          return np.nan
  
imports: from statsmodels.compat.python import lzip, lfilter
  import numpy
  import scipy.integrate
  from scipy.special import factorial
  from numpy import exp, multiply, square, divide, subtract, inf
label_desc: Use image node_id 5 for calling the CustomKernel obj's underlying member method code with example usage: obj.density(xs, x) and returns: w, np