% -*- texinfo -*- % @deftypefn {Function File} {} kullback_leibler_distance (@var{P}, @var{Q}) % % @var{P} and @var{Q} are probability distribution functions of the % @math{Dkl(P,Q) = \sum_x{ -P(x).log(Q(x)) + P(x).log(P(x))} % = \sum_x{ -P(x).log(P(x)/Q(x))}} % % Compute the Kullback-Leibler distance of two probability distributions % given, P & Q. % @example % @group % kullback_leibler_distance([0.2 0.3 0.5],[0.1 0.8 0.1]) % @result{} ans = 0.64910 % @end group % @end example % @end deftypefn