pareto-0.2.0.0: A library for cause-effect relationships.

Pareto

Synopsis

# Documentation

controlLimit :: Floating a => a -> a Source #

Determine control limit.

>>> controlLimit 10
2.7709505944546686

entropy :: (Foldable t, Floating a) => t a -> a Source #

Determine entropy for list of numbers

>>> entropy [0.3, 0.3, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05]
2.770950594454668
>>> entropy [789, 621, 109, 65, 45, 30, 27, 15, 12, 9]
1.9593816735406657

ratio :: (Foldable t, RealFrac a1, Fractional a, Floating a1) => t a1 -> a Source #

entropy divided by controlLimit.

>>> ratio [0.3, 0.3, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05]
1.0

pareto :: (Foldable t, RealFrac a, Floating a) => t a -> Bool Source #

Returns True if pareto distribution is present otherwise False.

>>> pareto [0.3, 0.3, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05]
True

causeEffect :: (RealFrac a1, Fractional b, Fractional a, Enum a) => [a1] -> [(a, b)] Source #

Return list of cause-effect pairs.

>>> causeEffect [789, 621, 109, 65, 45, 30, 27, 15, 12, 9]
[(0.1,0.458),(0.2,0.819),(0.3,0.882),(0.4,0.92),(0.5,0.946),(0.6,0.963),(0.7,0.979),(0.8,0.988),(0.9,0.995),(1.0,1.0)]

Which causes have the maximum concentration (rank * value)?

>>> causesMaxConcentration [789, 621, 109, 65, 45, 30, 27, 15, 12, 9]
0.2

effectsMaxConcentration :: Num a => [Float] -> Float Source #

Which effects have the maximum concentration (rank * value)?

>>> effectsMaxConcentration [789, 621, 109, 65, 45, 30, 27, 15, 12, 9]
0.819