summaryrefslogtreecommitdiff
path: root/packages/base/src/Internal/Random.hs
diff options
context:
space:
mode:
authorAlberto Ruiz <aruiz@um.es>2015-10-29 12:57:43 +0100
committerAlberto Ruiz <aruiz@um.es>2015-10-29 12:57:43 +0100
commit35a7f3355611cd20994f36b43acbd7413e09f558 (patch)
treee3a059183477ee2fc71e3a908c561332a403bcef /packages/base/src/Internal/Random.hs
parent3e5f71c9d711fabd0e0c45fc25c58bf34f88fe3b (diff)
bump versions, fix tests, thanks
Diffstat (limited to 'packages/base/src/Internal/Random.hs')
-rw-r--r--packages/base/src/Internal/Random.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/packages/base/src/Internal/Random.hs b/packages/base/src/Internal/Random.hs
index 8c792eb..60b2cef 100644
--- a/packages/base/src/Internal/Random.hs
+++ b/packages/base/src/Internal/Random.hs
@@ -31,13 +31,13 @@ import System.Random(randomIO)
31gaussianSample :: Seed 31gaussianSample :: Seed
32 -> Int -- ^ number of rows 32 -> Int -- ^ number of rows
33 -> Vector Double -- ^ mean vector 33 -> Vector Double -- ^ mean vector
34 -> Matrix Double -- ^ covariance matrix 34 -> Herm Double -- ^ covariance matrix
35 -> Matrix Double -- ^ result 35 -> Matrix Double -- ^ result
36gaussianSample seed n med cov = m where 36gaussianSample seed n med cov = m where
37 c = dim med 37 c = dim med
38 meds = konst' 1 n `outer` med 38 meds = konst' 1 n `outer` med
39 rs = reshape c $ randomVector seed Gaussian (c * n) 39 rs = reshape c $ randomVector seed Gaussian (c * n)
40 m = rs `mXm` cholSH cov `add` meds 40 m = rs `mXm` chol cov `add` meds
41 41
42-- | Obtains a matrix whose rows are pseudorandom samples from a multivariate 42-- | Obtains a matrix whose rows are pseudorandom samples from a multivariate
43-- uniform distribution. 43-- uniform distribution.