Copyright | (c) Eric Crockett 2011-2017 Chris Peikert 2011-2017 |
---|---|
License | GPL-3 |
Maintainer | ecrockett0@email.com |
Stability | experimental |
Portability | POSIX |
Safe Haskell | None |
Language | Haskell2010 |
Functions for sampling from a continuous Gaussian distribution.
Synopsis
- realGaussian :: forall v q m. (ToRational v, OrdFloat q, Random q, MonadRandom m) => v -> m (q, q)
- realGaussians :: (ToRational svar, OrdFloat i, Random i, Vector v i, MonadRandom m) => svar -> Int -> m (v i)
Documentation
realGaussian :: forall v q m. (ToRational v, OrdFloat q, Random q, MonadRandom m) => v -> m (q, q) Source #
Using polar form of Box-Muller transform, returns a pair of
centered, Gaussian-distributed real numbers with scaled variance
svar = true variance * (2*pi)
. See
<http://www.alpheratz.net/murison/Maple/GaussianDistribution/GaussianDistribution.pdf
this link> for details.
realGaussians :: (ToRational svar, OrdFloat i, Random i, Vector v i, MonadRandom m) => svar -> Int -> m (v i) Source #
Generate n
real, independent gaussians of scaled variance svar
= true variance * (2*pi)
.