diff options
Diffstat (limited to 'packages/base')
-rw-r--r-- | packages/base/THANKS.md | 2 | ||||
-rw-r--r-- | packages/base/hmatrix.cabal | 2 | ||||
-rw-r--r-- | packages/base/src/Internal/Random.hs | 4 |
3 files changed, 5 insertions, 3 deletions
diff --git a/packages/base/THANKS.md b/packages/base/THANKS.md index f331dea..55a428c 100644 --- a/packages/base/THANKS.md +++ b/packages/base/THANKS.md | |||
@@ -205,3 +205,5 @@ module reorganization, monadic mapVectorM, and many other improvements. | |||
205 | - Vassil Keremidchiev fixed the cabal options for OpenBlas, fixed several installation | 205 | - Vassil Keremidchiev fixed the cabal options for OpenBlas, fixed several installation |
206 | issues, and added support for stack-based build. | 206 | issues, and added support for stack-based build. |
207 | 207 | ||
208 | - Patrik Jansson changed meanCov and gaussianSample to use Herm type. Fixed stack.yaml. | ||
209 | |||
diff --git a/packages/base/hmatrix.cabal b/packages/base/hmatrix.cabal index 0cfbd88..9fa3c4e 100644 --- a/packages/base/hmatrix.cabal +++ b/packages/base/hmatrix.cabal | |||
@@ -1,5 +1,5 @@ | |||
1 | Name: hmatrix | 1 | Name: hmatrix |
2 | Version: 0.17.0.2 | 2 | Version: 0.18.0.0 |
3 | License: BSD3 | 3 | License: BSD3 |
4 | License-file: LICENSE | 4 | License-file: LICENSE |
5 | Author: Alberto Ruiz | 5 | Author: Alberto Ruiz |
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. |