Adding anomaly likelihood algorithm.

Fixes #945