Positive eigenvector coefficients with matlab

20 visualizzazioni (ultimi 30 giorni)
Hello, I need positive eigenvector coefficients. I am new in Matlab. I've thought to place eig function into fmincon function with the constraint e>=0. However, i couldn't manage it. How can i obtain positive eigenvector coefficients with matlab?
  2 Commenti
Kaushik Lakshminarasimhan
Kaushik Lakshminarasimhan il 12 Nov 2017
What do you mean by positive eigenvector coefficients? Do you just mean positive coefficients? Can you explain what you're trying to fit?
crocusy
crocusy il 12 Nov 2017
Yes, i mean positive coefficients. I need eigenvector coefficients all positive. I've tried to write something as below.
if true
f=@(e,l,g) eig(S);
e0=zeros(N,N);
e1=fmincon(f,e0,[],[],[],[],lb,[],[],opts);
end
There must be lb for eigenvector coefficients, i.e. e>=0 but I couldn't put it anywhere, since there are three outputs. When i write lb, it doesn't directly affect the coefficients. I know it is not rational, however i wonder if there is a way such that to find positive coefficients.

Accedi per commentare.

Risposta accettata

Walter Roberson
Walter Roberson il 12 Nov 2017
Any scalar constant times an eigenvector remains an eigenvector. Therefore if you have an eigenvector that contains all negative values, multiply it by a negative scalar.
If you have an eigenvector that contains a mix of negative and positive values, you need to reject it (for your purpose) and move on to the next eigenvector. You would not do this with fmincon or the like: you would just look through the list of eigenvectors that were output to find one for which the sign() was the same for all of the elements.
Question: do you consider 0 to be positive for this purpose?
  1 Commento
crocusy
crocusy il 13 Nov 2017
Yes, 0 is considered as positive. Indeed, i need nonnegative cofficients. Thank you for your answer. It helped me a lot.

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Linear Algebra in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by