nytlabs/streamtools — pull request #381 by mikedewar (2014-04-14 02:44:40+00:00)
Title: KullbackLeibler Divergence

The KL block has two inbound routes `P` and `Q`. The block, once it has the output of a Histogram block on both its routes computes the KL divergence, "a non-symmetric measure of the difference between two probability distributions".

It uses the mechanisms present in the join block to handle routing - indeed it might make sense to make this require two paths - a path to the `P` distribution and a path to the `Q` distribution. A pattern could then be histograms -> join -> KL -> sink.