Skip to content

ls documentation could use clarification #122

@kxygk

Description

@kxygk

the documentation for ls could maybe be clarified a bit.

if you have ax=b
a is 3-by-2
b is 3-by-1
then
x should be 2-by-1

ls! as well as ls however both returns a 3-by-1
The docstring however strongly suggests you will get x back!

at least with ls! this is maybe understandable b/c it's reusing memory - but it'd be nice to make a note of what's going on

I was scratching my head for a couple hours trying to figure out what the heck was going on and why my results were the wrong dimension. I only figured it out when I saw in your example: https://dragan.rocks/articles/17/Clojure-Numerics-5-Orthogonalization-and-Least-Squares that the value corresponds to unused terms in the direct QR backsubstitution

Subsequent rows should just discarded if you are looking for the least squared solutions to your b columns

Thanks for the great library as always :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions