summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Dobsan <pdobsan@gmail.com>2018-04-28 21:22:02 +0200
committerPeter Dobsan <pdobsan@gmail.com>2018-04-28 21:22:02 +0200
commit9c84385e8a546a54a4eb24402a0d881748090e07 (patch)
tree4c546fceedcee4ce2b3a69b29911e993a5e552ae
parent3ffea9114b573eb11e2e41ddfc6a8b69fdd6baed (diff)
Corrected two haddock examples left out previously.
-rw-r--r--packages/base/src/Internal/Container.hs31
1 files changed, 8 insertions, 23 deletions
diff --git a/packages/base/src/Internal/Container.hs b/packages/base/src/Internal/Container.hs
index d64523d..20114a0 100644
--- a/packages/base/src/Internal/Container.hs
+++ b/packages/base/src/Internal/Container.hs
@@ -41,12 +41,9 @@ import Prelude hiding ((<>))
41[-3.0,-0.5,2.0,4.5,7.0] 41[-3.0,-0.5,2.0,4.5,7.0]
42it :: Vector Double 42it :: Vector Double
43 43
44>>> linspace 5 (8,2+i) :: Vector (Complex Double) 44>>> linspace 5 (8,2:+1) :: Vector (Complex Double)
45 45[8.0 :+ 0.0,6.5 :+ 0.25,5.0 :+ 0.5,3.5 :+ 0.75,2.0 :+ 1.0]
46<interactive>:6:17: ERROR: 46it :: Vector (Complex Double)
47 Variable not in scope: i :: Complex Double
48
49fromList [8.0 :+ 0.0,6.5 :+ 0.25,5.0 :+ 0.5,3.5 :+ 0.75,2.0 :+ 1.0]
50 47
51Logarithmic spacing can be defined as follows: 48Logarithmic spacing can be defined as follows:
52 49
@@ -211,23 +208,11 @@ optimiseMult = mconcat
211 208
212{- | Compute mean vector and covariance matrix of the rows of a matrix. 209{- | Compute mean vector and covariance matrix of the rows of a matrix.
213 210
214>>> meanCov $ gaussianSample 666 1000 (fromList[4,5]) (diagl[2,3]) 211>>> meanCov $ gaussianSample 666 1000 (fromList[4,5]) (trustSym $ diagl [2,3])
215 212([3.9933155655086696,5.061409102770331],Herm (2><2)
216<interactive>:4:52: ERROR: 213 [ 1.9963242906624408, -4.227815571404954e-2
217 • Couldn't match expected type ‘Herm Double’ 214 , -4.227815571404954e-2, 3.2003833097832857 ])
218 with actual type ‘Matrix Double’ 215it :: (Vector Double, Herm Double)
219 • In the fourth argument of ‘gaussianSample’, namely
220 ‘(diagl [2, 3])’
221 In the second argument of ‘($)’, namely
222 ‘gaussianSample 666 1000 (fromList [4, 5]) (diagl [2, 3])’
223 In the expression:
224 meanCov $ gaussianSample 666 1000 (fromList [4, 5]) (diagl [2, 3])
225
226(fromList [4.010341078059521,5.0197204699640405],
227(2><2)
228 [ 1.9862461923890056, -1.0127225830525157e-2
229 , -1.0127225830525157e-2, 3.0373954915729318 ])
230
231-} 216-}
232meanCov :: Matrix Double -> (Vector Double, Herm Double) 217meanCov :: Matrix Double -> (Vector Double, Herm Double)
233meanCov x = (med,cov) where 218meanCov x = (med,cov) where