I have a problem where I have a vector "c" which I know its values and it size is 100, and I want my code to find a vector "x" of size 30 and a matrix "y" of size (30,100), so that x*y= c and the norm of "x" and "y" are minimal. I want to know the algorithm, so that I can do this for any c or change the dimensions of the vectors and matrices.
I tried using sympy and linalg.lstsq, but as far as I saw, both don't solve the problem for x and y at the same time. And tried one approach by making x to be random with a seed, but that is something I want to avoid since what I want is a method that adjust both x and y from a data given by the user and don't depend on data that doesn't come from the user (or I'll will have to give unique seeds for each user).
Thanks for your help
Well, I got a solution for the problem from here: Solving least-norm problem with Bilinear constraints
Using the equation of ||a||= squared root of ||c||, I can use this to solve an optimization problem for vector x
Then use another optimization problem to find y_opt from vector x and c
With these, given a vector c, you can find a vector 'x' and a matrix 'y' that satisfy the system, the resolve function is to avoid the round errors of the computation of 'x', otherwise you can compute y_opt using the equation given in the post