diff options
Diffstat (limited to 'packages/base/src')
-rw-r--r-- | packages/base/src/Internal/Random.hs | 4 |
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) | |||
31 | gaussianSample :: Seed | 31 | gaussianSample :: 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 |
36 | gaussianSample seed n med cov = m where | 36 | gaussianSample 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. |