Safe Haskell | None |
---|
Use this package to compute maximum entropy distributions given a list of values and list of constraints.
Here is a the example from Probability the Logic of Science
maxent ([1,2,3], [average 1.5])
Right [0.61, 0.26, 0.11]
The classic dice example
maxent ([1,2,3,4,5,6], [average 4.5])
Right [.05, .07, 0.11, 0.16, 0.23, 0.34]
- type Constraint a = (a -> a, a)
- constraint :: Floating a => (a -> a) -> a -> Constraint a
- average :: Floating a => a -> Constraint a
- variance :: Floating a => a -> Constraint a
- maxent :: (forall a. Floating a => ([a], [Constraint a])) -> Either (Result, Statistics) [Double]
Documentation
type Constraint a = (a -> a, a)Source
Constraint type. Think of this as f and c in sum pi (f x) = c
constraint :: Floating a => (a -> a) -> a -> Constraint aSource
average :: Floating a => a -> Constraint aSource
variance :: Floating a => a -> Constraint aSource
:: (forall a. Floating a => ([a], [Constraint a])) | A pair of values that the distributions is over and the constraints |
-> Either (Result, Statistics) [Double] | Either the a discription of what wrong or the probability distribution |
The main entry point for computing discrete maximum entropy distributions.