diff options
Diffstat (limited to 'packages')
-rw-r--r-- | packages/base/src/Internal/Container.hs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/packages/base/src/Internal/Container.hs b/packages/base/src/Internal/Container.hs index b08f892..b379530 100644 --- a/packages/base/src/Internal/Container.hs +++ b/packages/base/src/Internal/Container.hs | |||
@@ -28,7 +28,7 @@ import Internal.Vector | |||
28 | import Internal.Matrix | 28 | import Internal.Matrix |
29 | import Internal.Element | 29 | import Internal.Element |
30 | import Internal.Numeric | 30 | import Internal.Numeric |
31 | import Internal.Algorithms(Field,linearSolveSVD) | 31 | import Internal.Algorithms(Field,linearSolveSVD,Herm,mTm) |
32 | 32 | ||
33 | ------------------------------------------------------------------ | 33 | ------------------------------------------------------------------ |
34 | 34 | ||
@@ -206,14 +206,14 @@ optimiseMult = mconcat | |||
206 | , -1.0127225830525157e-2, 3.0373954915729318 ]) | 206 | , -1.0127225830525157e-2, 3.0373954915729318 ]) |
207 | 207 | ||
208 | -} | 208 | -} |
209 | meanCov :: Matrix Double -> (Vector Double, Matrix Double) | 209 | meanCov :: Matrix Double -> (Vector Double, Herm Double) |
210 | meanCov x = (med,cov) where | 210 | meanCov x = (med,cov) where |
211 | r = rows x | 211 | r = rows x |
212 | k = 1 / fromIntegral r | 212 | k = 1 / fromIntegral r |
213 | med = konst k r `vXm` x | 213 | med = konst k r `vXm` x |
214 | meds = konst 1 r `outer` med | 214 | meds = konst 1 r `outer` med |
215 | xc = x `sub` meds | 215 | xc = x `sub` meds |
216 | cov = scale (recip (fromIntegral (r-1))) (trans xc `mXm` xc) | 216 | cov = scale (recip (fromIntegral (r-1))) (mTm xc) |
217 | 217 | ||
218 | -------------------------------------------------------------------------------- | 218 | -------------------------------------------------------------------------------- |
219 | 219 | ||
@@ -293,5 +293,3 @@ remap i j m | |||
293 | | otherwise = error $ "out of range index in remap" | 293 | | otherwise = error $ "out of range index in remap" |
294 | where | 294 | where |
295 | [i',j'] = conformMs [i,j] | 295 | [i',j'] = conformMs [i,j] |
296 | |||
297 | |||