statistics
statistics copied to clipboard
Invalid documentation for `ols`?
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 the r <- M.replicate n n 0 and a <- M.thaw mat (aka q))
multiplyV :: Matrix m n -> Vector n -> Vector m
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 ~~columns~~ rows in /A/"?