我正在尝试使用hmatrix
, 和hmatrix-gsl-stats
. 但我得到了绝对奇怪的结果。任何人都可以重现我所看到的吗?
import Numeric.LinearAlgebra
import Numeric.GSL.Fitting.Linear
main :: IO ()
main = do
let y = fromList [1,2,3,4,5]
let x = trans $ fromLists [[1,2,3,4,5], [1,1,1,1,1]]
let x3 = fromLists [[1,1], [2,1], [3,1], [4,1], [5,1]]
print $ x == x3
print $ multifit x y
print $ multifit x3 y
所以我只是编译并运行它,我得到:
True
(fromList [0.6121951219512196,0.39756097560975645],(2><2)
[ 0.5100317271465397, -0.46568114217727535
, -0.46568114217727535, 0.82048582193139 ],27.27560975609756)
(fromList [1.0000000000000002,-8.881784197001252e-16],(2><2)
[ 2.1364982849735737e-32, -6.40949485492072e-32
, -6.40949485492072e-32, 2.350148113470931e-31 ],6.409494854920721e-31)
我错过了一些完全明显的东西吗?