def gpke(bw, data, data_predict, var_type, ckertype='gaussian', okertype='wangryzin', ukertype='aitchisonaitken', tosum=True):
 kertypes = dict(c=ckertype, o=okertype, u=ukertype)
 Kval = np.empty(data.shape)
 for (ii, vtype) in enumerate(var_type):
  func = kernel_func[kertypes[vtype]]
  Kval[:, ii] = func(bw[ii], data[:, ii], data_predict[ii])
 iscontinuous = np.array([(c == 'c') for c in var_type])
 dens = (Kval.prod(axis=1) / np.prod(bw[iscontinuous]))
 if tosum:
  return dens.sum(axis=0)
 else:
  return dens

def gpke ( bw , data , data_predict , var_type , ckertype = 'gaussian' , okertype = 'wangryzin' , ukertype = 'aitchisonaitken' , tosum = True ) : kertypes = dict ( c = ckertype , o = okertype , u = ukertype ) Kval = np . empty ( data . shape ) for ( ii , vtype ) in enumerate ( var_type ) : func = kernel_func [ kertypes [ vtype ] ] Kval [ : , ii ] = func ( bw [ ii ] , data [ : , ii ] , data_predict [ ii ] ) iscontinuous = np . array ( [ ( c == 'c' ) for c in var_type ] ) dens = ( Kval . prod ( axis = 1 ) / np . prod ( bw [ iscontinuous ] ) ) if tosum : return dens . sum ( axis = 0 ) else : return dens
returns the non-normalized generalized product kernel estimator parameters bw: 1-d ndarray the user-specified bandwidth parameters .