And so I don't see how ols is supposed to typecheck:
ols :: Matrix m n -> Vector n -> Vector ?
ols a b = solve r (transpose q {- :: Matrix n m -} `multiplyV` b) -- mismatch b should have type Vector m
where (q,r) = qr a -- q :: Matrix m n, r :: Matrix n n
Is the comment for ols wrong? Should it read "/b/ has the same length as columnsrows in /A/"?
I have been porting part of this library to Idris and so I have been looking at it with more precise types in mind. Which leads me to:
solve :: Matrix m m -> Vector m -> Vector m
qr :: Matrix m n -> (Matrix m n, Matrix n n)
(Note ther <- M.replicate n n 0
anda <- M.thaw mat
(akaq
))multiplyV :: Matrix m n -> Vector n -> Vector m
And so I don't see how
ols
is supposed to typecheck:Is the comment for
ols
wrong? Should it read "/b/ has the same length ascolumnsrows in /A/"?