How to find the vector coefficients given the equation X + N*V > 0
2 views (last 30 days)
Show older comments
I have a nx1 vector X, nxm matrix N, and am trying to find the values for mx1 vector V such that X + N*V > 0
I tried to use V > -X*pinv(N) but I am not getting the right V, as in when I plug the V back in, I do not get values greater than or equal to 0. I'm not sure what the right approach is here. Any advice is appreciated!
0 Comments
Answers (1)
John D'Errico
on 14 Dec 2016
Edited: John D'Errico
on 14 Dec 2016
Without seeing what your matrices are, it is difficult to help you too much.
How do you know what the "right" V is? Yes, you want the residuals to be positive, but people want lots of things they cannot have.
There is no constraint in the use of pinv that this difference will be positive. You will get whatever your matrix indicates is appropriate to solve the problem, in a least squares sense. That means you will have lots of positive and negative values!
You can use lsqlin. Apply inequality constraints. Note that you will still get tiny negative results, due to floating point arithmetic. Again, people want lots of things they cannot have. You can always add a tiny amount to the constraint, constraining
X + N*V >= delta
for small delta.
0 Comments
See Also
Categories
Find more on Linear Least Squares in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!