probable alternatives and similar packages
Based on the "Math" category.
Alternatively, view probable alternatives based on common mentions on social networks and blogs.
-
vector
An efficient implementation of Int-indexed arrays (both mutable and immutable), with a powerful loop optimisation framework . -
statistics
A fast, high quality library for computing with statistics in Haskell. -
HerbiePlugin
GHC plugin that improves Haskell code's numerical stability -
hgeometry
HGeometry is a library for computing with geometric objects in Haskell. It defines basic geometric types and primitives, and it implements some geometric data structures and algorithms. The main two focusses are: (1) Strong type safety, and (2) implementations of geometric algorithms and data structures that have good asymptotic running time guarantees. -
dimensional
Dimensional library variant built on Data Kinds, Closed Type Families, TypeNats (GHC 7.8+). -
computational-algebra
General-Purpose Computer Algebra System as an EDSL in Haskell -
mwc-random
A very fast Haskell library for generating high quality pseudo-random numbers. -
numhask
A haskell numeric prelude, providing a clean structure for numbers and operations that combine them. -
poly
Fast polynomial arithmetic in Haskell (dense and sparse, univariate and multivariate, usual and Laurent) -
cf
"Exact" real arithmetic for Haskell using continued fractions (Not formally proven correct) -
optimization
Some numerical optimization methods implemented in Haskell -
safe-decimal
Safe and very efficient arithmetic operations on fixed decimal point numbers -
equational-reasoning
Agda-style equational reasoning in Haskell -
sbvPlugin
Formally prove properties of Haskell programs using SBV/SMT. -
monoid-subclasses
Subclasses of Monoid with a solid theoretical foundation and practical purposes -
polynomial
Haskell library for manipulating and evaluating polynomials -
eigen
Haskel binding for Eigen library. Eigen is a C++ template library for linear algebra: matrices, vectors, numerical solvers, and related algorithms. -
vector-th-unbox
Deriver for unboxed vectors using Template Haskell
Static code analysis for 29 languages.
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of probable or a related project?
README
probable
Simple random value generation for haskell, using an efficient random generator and minimizing system calls. But the library also lets you work with distributions over a finite set, adapting code from Eric Kidd's posts, and all the usual distributions covered in the statistics package.
You can see how it looks in examples, or below. You can view the documentation for 0.1 here.
Example
Simple example of random generation for your types, using probable.
module Main where
import Control.Applicative
import Control.Monad
import Math.Probable
import qualified Data.Vector.Unboxed as VU
data Person = Person
{ age :: Int
, weight :: Double
, salary :: Int
} deriving (Eq, Show)
person :: RandT IO Person
person =
Person <$> intIn (1, 100)
<*> doubleIn (2, 130)
<*> intIn (500, 10000)
randomPersons :: Int -> IO [Person]
randomPersons n = mwc $ listOf n person
randomDoubles :: Int -> IO (VU.Vector Double)
randomDoubles n = mwc $ vectorOf n double
main :: IO ()
main = do
randomPersons 10 >>= mapM_ print
randomDoubles 10 >>= VU.mapM_ print
Distributions over finite sets, conditional probabilities and random sampling.
module Main where
import Math.Probable
import qualified Data.Vector as V
data Book = Interesting
| Boring
deriving (Eq, Show)
bookPrior :: Finite d => d Book
bookPrior = weighted [ (Interesting, 0.2)
, (Boring, 0.8)
]
twoBooks :: Finite d => d (Book, Book)
twoBooks = do
book1 <- bookPrior
book2 <- bookPrior
return (book1, book2)
sampleBooks :: RandT IO (V.Vector Book)
sampleBooks = vectorOf 10 bookPrior
oneInteresting :: Fin (Book, Book)
oneInteresting = bayes $ do
(b1, b2) <- twoBooks
condition (b1 == Interesting || b2 == Interesting)
return (b1, b2)
main :: IO ()
main = do
print $ exact bookPrior
mwc sampleBooks >>= print
print $ exact twoBooks
print $ exact oneInteresting
Contact
This library is written and maintained by Alp Mestanogullari.
Feel free to contact me for any feedback, comment, suggestion, bug report and what not.