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: shape should be a function taking and returning numeric type.
  
  For sanity it should always return positive or zero but this is not
  enforced in case you want to do weird things. Bear in mind that the
  statistical tests etc. may not be valid for non-positive kernels.
  
  The bandwidth of the kernel is supplied as h.
  
  You may specify a domain as a list of 2 values [min, max], in which case
  kernel will be treated as zero outside these values. This will speed up
  calculation.
  
  You may also specify the normalisation constant for the supplied Kernel.
  If you do this number will be stored and used as the normalisation
  without calculation.  It is recommended you do this if you know the
  constant, to speed up calculation.  In particular if the shape function
  provided is already normalised you should provide norm = 1.0.
  
  Warning: I think several calculations assume that the kernel is
  normalized. No tests for non-normalized kernel.
code: def __init__(self, shape, h=1.0, domain=None, norm=None):
      """
      shape should be a function taking and returning numeric type.
  
      For sanity it should always return positive or zero but this is not
      enforced in case you want to do weird things. Bear in mind that the
      statistical tests etc. may not be valid for non-positive kernels.
  
      The bandwidth of the kernel is supplied as h.
  
      You may specify a domain as a list of 2 values [min, max], in which case
      kernel will be treated as zero outside these values. This will speed up
      calculation.
  
      You may also specify the normalisation constant for the supplied Kernel.
      If you do this number will be stored and used as the normalisation
      without calculation.  It is recommended you do this if you know the
      constant, to speed up calculation.  In particular if the shape function
      provided is already normalised you should provide norm = 1.0.
  
      Warning: I think several calculations assume that the kernel is
      normalized. No tests for non-normalized kernel.
      """
      self._normconst = norm  # a value or None, if None, then calculate
      self.domain = domain
      self.weights = None
      if callable(shape):
          self._shape = shape
      else:
          raise TypeError("shape must be a callable object/function")
      self._h = h
      self._L2Norm = None
      self._kernel_var = None
      self._normal_reference_constant = None
      self._order = None
  
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 1 to create a new CustomKernel object  with example: obj = CustomKernel(shape, h, domain, norm)