|
From: | MarkSheedy |
Subject: | RE: quadprog->qp newbie help |
Date: | Wed, 28 Mar 2012 00:55:06 -0700 (PDT) |
Ah, yes, I see now. Sorry for not RTFM’ing better.
I have now incorporated this into my main work and all is good.
From: forkandwait [via Octave] [mailto:ml-node+[hidden email]]
Sent: 27 March 2012 17:31
To: Mark Sheedy
Subject: Re: quadprog->qp newbie help
MarkSheedy <mark.sheedy <at> edftrading.com> writes:
>
> Hello,
>
> I am converting some code that uses the MatLab quadprog function to the
> Octave qp function.
You want the following Octave code (I am *almost* sure):
[X, OBJ, INFO, LAMBDA] = qp([], H,f, [], [], lb, [], [], A, b)
The problem you had in translating is that ML uses "A" and "b" to refer to the
inequality constraint matrix and vector in their docs, while Octave uses "A_in"
and "A_ub" to refer the same thing. Octave puts them at the end instead of the
front, contra ML.
In the Octave documentation, "A" and "b" refer to the equality constraints, NOT
inequality. The way you called qp() provided an overdetermined matrix for
equality constraint. You could have solved the system from your A\b to give
[0.77; 1.37]; when you feed this into qp() you x=[0.77; 1.37] since you have set
an *equality* constraint to be such. I think this is what happened when you
disabled the check in qp.m
http://www.gnu.org/software/octave/doc/interpreter/Quadratic-Programming.html
The fifth example down shows how to call it with an inequality matrix.
As I understand it, Octave's qp() matches the older ML's qp(), which they
changed sometime in the last decade. Lame.
Let me know if that works or helps.
_______________________________________________
Help-octave mailing list
[hidden email]
https://mailman.cae.wisc.edu/listinfo/help-octave
If you reply to this email, your message will be added to the discussion below:
http://octave.1599824.n4.nabble.com/quadprog-qp-newbie-help-tp4508688p4509398.html
To unsubscribe from quadprog->qp newbie help,
click here.
NAML
[Prev in Thread] | Current Thread | [Next in Thread] |