Is there a way to constrain singular value decomposition results?

12 views (last 30 days)
I am using the svd function to slove a system of linear equations describing a mixing scenario. The point of the calculations is to solve Ax = b so that I find x, where x is a vector of different mixing proportions of different components to our system and they sum to 1 (e.g., x1 + x2 + ... xn = 1). After finding the U, S, and V matrices I solved for x, giving me the component mixing proportions. However, for some of my results, some proportions are greater than 1 while some are negative. While I understand that these results are mathematically correct, but I am wondering if there is a way for me to constain these x values so that results will be limited to values between 0 and 1.
I have used the lsqlin function as well which lets me constrain the upper and lower bounds so I am looking for something of similar effect for the svd method. Any help is greatly appreciated!
  4 Comments

Sign in to comment.

Answers (2)

Matt J
Matt J on 14 Jun 2023
Edited: Matt J on 14 Jun 2023
The closest analogue I can think of would be as follows. This could only make sense, though, if yo were trying to do some sort of constrained PCA.
[U,S,V]=svd(A);
r=rank(S,tol); %or just set r to be desired number of principal components
%discard negligible singular values and vectors
C=S(1:r,1:r)*V(:,1:r)';
d=U(:,1:r)'*b;
x=lsqlin(C,d,[],[],ones(1,4),1,zeros(4,1),[]);

John D'Errico
John D'Errico on 14 Jun 2023
No. You cannot constrain the SVD (as employed by PINV, I assume) to yield a solution that obeys bound constraints.
That computation solves for a minimum norm solution, but there is no way to force it to obey bound constraints. AND, if you could find a way to make the PINV (so SVD based) solution satisy bound constraints, then it would almost certainly yield identical results to what lsqlin provides. Anyway, only if the system is singular would you have any choice in the matter, and you have not suggested this is the case.
If the matrix is singular, then you would have some argument that multiple solutions could be found. But even then, there is litttle to be gained from an SVD based solution. It is unlikely on this small of a problem to be faster, since both will be quite fast on small problems, but anything you could do to enforce bound constraints won't be faster than lsqlin.

Products


Release

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!