
19 Apr
2009
19 Apr
'09
5:53 a.m.
http://ccnmtl.columbia.edu/projects/qmss/the_chisquare_test/about_the_chisqu... given two matrices, Prelude Data.Matrix.Dense Data.Vector.Dense> m listMatrix (2,2) [46.0,37.0,71.0,83.0] Prelude Data.Matrix.Dense Data.Vector.Dense> es listMatrix (2,2) [40.9746835443038,42.0253164556962,76.0253164556962,77.9746835443038] how can I flatten them to do: [ (o-e)^2 / e | o <- m, e <- es ] or use a function that will apply a given function to every corresponding elements of 2 or n matrices and create a result matrix? If I should use a different matrix type or library altogether, please specify which one and how ^__^" Best Regards, Cetin Sert