How to find the vector coefficients given the equation X + N*V > 0

1 次查看(过去 30 天)
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!

回答(1 个)

John D'Errico
John D'Errico 2016-12-14
编辑:John D'Errico 2016-12-14
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.

类别

Help CenterFile Exchange 中查找有关 Linear Least Squares 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by