octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #47314] optim package: quadprog() equality con


From: Olaf Till
Subject: [Octave-bug-tracker] [bug #47314] optim package: quadprog() equality constraints have opposite sign
Date: Sat, 26 Mar 2016 15:17:47 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Firefox/38.0 Iceweasel/38.6.1

Follow-up Comment #11, bug #47314 (project octave):

My memory was wrong, quadprog does _not_ seem to return always positve lambda.
But take a look at the example anyway:


T = [3, 1; 1, 4];
H = T * T';
F = [1, -2];
[x, ~, ~, ~, lambda1] = quadprog (H, F, [], [], A, 0)
x =

   0.0081566
   0.0048940

lambda1 =

  scalar structure containing the fields:

    lower = [](0x0)
    upper = [](0x0)
    eqlin = -0.37194
    ineqlin = [](0x0)

[x, ~, ~, ~, lambda1] = quadprog (H, F, [], [], A, 0)
x =

   0.0081566
   0.0048940

lambda1 =

  scalar structure containing the fields:

    lower = [](0x0)
    upper = [](0x0)
    eqlin = -0.37194
    ineqlin = [](0x0)

F' + H * x
ans =

   1.1158
  -1.8597

A' * lambda1.eqlin
ans =

   1.1158
  -1.8597


The last two commands compare the function derivative with constraints
derivative times lambda. That they are equal even in sign seems more intuitive
(though not specified) for using in an application than Matlabs behaviour
(though also correct). (You probably checked the same for Matlab, since you
use lambda?)

There is also the aspect that there are other frontends in Octave for that
algorythm. I'm still not sure what to do.



    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?47314>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]