Processing math: 100%
SciPy

This is documentation for an old release of SciPy (version 0.17.1). Read this page in the documentation of the latest stable release (version 1.15.1).

scipy.special.rel_entr

scipy.special.rel_entr(x, y) = <ufunc 'rel_entr'>

Elementwise function for computing relative entropy.

rel_entr(x,y)={xlog(x/y)x>0,y>00x=0,y0otherwise
Parameters:

x : ndarray

First input array.

y : ndarray

Second input array.

Returns:

res : ndarray

Output array.

See also

entr, kl_div

Notes

This function is jointly convex in x and y.

New in version 0.14.0.

Previous topic

scipy.special.entr

Next topic

scipy.special.kl_div