Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid documentation for ols? #200

Open
gallais opened this issue Feb 22, 2023 · 0 comments
Open

Invalid documentation for ols? #200

gallais opened this issue Feb 22, 2023 · 0 comments

Comments

@gallais
Copy link

gallais commented Feb 22, 2023

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/"?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant