class_docstr: Cosine Kernel
  
  K(u) = pi/4 cos(0.5 * pi * u) between -1.0 and 1.0
class_docstr_tok: ["Cosine","Kernel","K","(","u",")","=","pi\/4","cos","(","0.5","*","pi","*","u",")","between","-1.0","and","1.0"]
code: def __init__(self, h=1.0):
      CustomKernel.__init__(
          self,
          shape=lambda x: 0.78539816339744828 * np.cos(np.pi / 2.0 * x),
          h=h,
          domain=[-1.0, 1.0],
          norm=1.0,
      )
      self._L2Norm = np.pi**2 / 16.0
      self._kernel_var = 0.1894305308612978  # = 1 - 8 / np.pi**2
      self._order = 2
  
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 Cosine object from inherited base classes: CustomKernel with example: obj = Cosine(h)