Fitting equation system for triangular matrix

Matthias Brennwald <[email protected]> Sun, 2 Oct 2022 13:32:50 +0200
Newsgroups gmane.comp.gnu.octave.general
Message-ID <CAEzcwTFm0e5chKGbHv6nch0Mn6AK6xs=oi8JvmcrsvdAXighbg@mail.gmail.com>
I am trying to fit a triangular matrix A to an equation system y = A*x,
where x and y are two vectors of the same size.

If A would could be just any rectangular matrix, the following would work:
x = rand(10,1); y = rand(10,1); # some random vectors
A = y/x;  # matrix such that y = A*x

However, I'd like A to be lower triangular, because the physics behind my
problem dictate this. The coefficients in A should be such that A solves y
= A*x in a least-squares sense. I suspect this is really a basic
linear-algebra question, but I am not sure. How do I do that in Octave?


----------
We are transitioning to a web based forum
for community help discussions at
https://octave.discourse.group/c/help