-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnormaldistribution.cabal
executable file
·56 lines (52 loc) · 2.11 KB
/
normaldistribution.cabal
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
Name: normaldistribution
Version: 1.1.0.3
License: BSD3
License-File: LICENSE
Copyright: Bjorn Buckwalter 2011
Author: Bjorn Buckwalter
Maintainer: [email protected]
Stability: Stable
Homepage: https://github.com/bjornbm/normaldistribution
Synopsis:
Minimum fuss normally distributed random values.
Description:
This purpose of this library is to have a simple API and no
dependencies beyond Haskell 98 in order to let you produce
normally distributed random values with a minimum of fuss. This
library does /not/ attempt to be blazingly fast nor to pass
stringent tests of randomness. It attempts to be very easy to
install and use while being \"good enough\" for many applications
(simulations, games, etc.). The API builds upon and is largely
analogous to that of the Haskell 98 @Random@ module (more
recently @System.Random@).
.
Pure:
.
> (sample,g) = normal myRandomGen -- using a Random.RandomGen
> samples = normals myRandomGen -- infinite list
> samples2 = mkNormals 10831452 -- infinite list using a seed
.
In the IO monad:
.
> sample <- normalIO
> samples <- normalsIO -- infinite list
.
With custom mean and standard deviation:
.
> (sample,g) = normal' (mean,sigma) myRandomGen
> samples = normals' (mean,sigma) myRandomGen
> samples2 = mkNormals' (mean,sigma) 10831452
.
> sample <- normalIO' (mean,sigma)
> samples <- normalsIO' (mean,sigma)
.
Internally the library uses the Box-Muller method to generate
normally distributed values from uniformly distributed random values.
If more than one sample is needed taking samples off an infinite
list (created by e.g. 'normals') will be roughly twice as efficient
as repeatedly generating individual samples with e.g. 'normal'.
Category: Math, Statistics
Build-Type: Simple
Build-Depends: base < 5, random < 2
Exposed-Modules: Data.Random.Normal
Extra-source-files: README, LICENSE