def wang_ryzin(h, Xi, x):
 Xi = Xi.reshape(Xi.size)
 kernel_value = ((0.5 * (1 - h)) * (h ** abs((Xi - x))))
 idx = (Xi == x)
 kernel_value[idx] = (idx * (1 - h))[idx]
 return kernel_value

def wang_ryzin ( h , Xi , x ) : Xi = Xi . reshape ( Xi . size ) kernel_value = ( ( 0.5 * ( 1 - h ) ) * ( h ** abs ( ( Xi - x ) ) ) ) idx = ( Xi == x ) kernel_value [ idx ] = ( idx * ( 1 - h ) ) [ idx ] return kernel_value
the wang-ryzin kernel .