packages feed

hstatistics 0.2.2.8 → 0.2.2.9

raw patch · 3 files changed

+6/−3 lines, 3 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

CHANGES view
@@ -72,3 +72,6 @@  0.2.2.8: 		fixed definition of mutual information to be non-negative++0.2.2.9:+		divide mutual information/entropy by sample size
hstatistics.cabal view
@@ -1,5 +1,5 @@ Name:               hstatistics-Version:            0.2.2.8+Version:            0.2.2.9 License:            BSD3 License-file:       LICENSE Copyright:          (c) A.V.H. McPhail 2010, 2011
lib/Numeric/Statistics/Information.hs view
@@ -42,7 +42,7 @@         -> Vector Double           -- ^ the sequence         -> Double                  -- ^ the entropy entropy p x = let ps = probability p x-              in negate $ dot ps (logE ps)+              in negate $ (dot ps (logE ps)) / (fromIntegral $ dim x)  -- | the mutual information \sum_x \sum_y p(x,y) \ln{\frac{p(x,y)}{p(x)p(y)}} mutual_information :: (PDF a Double, PDF b (Double,Double)) @@ -54,6 +54,6 @@ mutual_information p px py (x,y) = let ps = probability p $ zipVector x y                                        xs = probability px x                                        ys = probability py y-                                   in dot ps (logE ps - logE (xs*ys)) +                                   in (dot ps (logE ps - logE (xs*ys))) / (fromIntegral $ dim x)   -----------------------------------------------------------------------------