I have an overdetermined linear system $Ax = b$. I need to choose an $x$. $x$ has about 100 elements in it.
If I had the matrix $A$, I would set x equal $A^\dagger b$, the pseudoinverse of $A$ times $b$. I'm using matlab, and so I could do this easily with the backslash operator.
My problem is that I don't have the matrix $A$, instead I have a function that returns $Ax$ given a vector $x$. If I were to construct $A$ from the transformation of basis vectors, it would take a long time, it would be very large, and it would be data dependent. Thus, this is not a great solution.
Is there a better way? Any suggestions?
Thanks for your help.
Is $A$ symmetric, or do you have a function that can also compute $A^Tx$? If so, you can run iterative algorithms like the method of conjugate gradients on the linear system $$A^TAx = A^Tb.$$
Otherwise, in the worst case, you can recover the matrix by querying $Ae_i$ for all basis vectors $e_i$.