[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #63178] Incorrect lambda for lsqnonneg and pqp
From: |
Arun Giridhar |
Subject: |
[Octave-bug-tracker] [bug #63178] Incorrect lambda for lsqnonneg and pqpnonneg |
Date: |
Fri, 7 Oct 2022 06:10:14 -0400 (EDT) |
URL:
<https://savannah.gnu.org/bugs/?63178>
Summary: Incorrect lambda for lsqnonneg and pqpnonneg
Project: GNU Octave
Submitter: arungiridhar
Submitted: Fri 07 Oct 2022 06:10:11 AM EDT
Category: Octave Function
Severity: 3 - Normal
Priority: 5 - Normal
Item Group: Unexpected Error or Warning
Status: None
Assigned to: None
Originator Name:
Originator Email:
Open/Closed: Open
Release: 7.2.0
Discussion Lock: Any
Operating System: Any
_______________________________________________________
Follow-up Comments:
-------------------------------------------------------
Date: Fri 07 Oct 2022 06:10:11 AM EDT By: Arun Giridhar <arungiridhar>
It turns out that the previously undocumented output "lambda" from the
functions lsqnonneg and pqpnonneg was supposed to be a Lagrange multiplier,
not a conjugate gradient. Matlab returns the Lagrange multiplier correctly
(see https://octave.discourse.group/t/what-does-matlab-do-for-this-code/3374).
In Octave, there was a bug in the calculation of that output in both functions
causing the duality logic to be violated, and in some cases Octave would also
have a size mismatch error.
The error can be replicated with this test:
[x, ~, ~, ~, ~, lambda] = lsqnonneg ([1 0; 0 1; 2 1], [1 1 3]'); assert (x
.* lambda, [0 0]')
[x, ~, ~, ~, ~, lambda] = lsqnonneg ([1 0; 0 1; 2 1], [1 -1 1]'); assert (x
.* lambda, [0 0]')
[x, ~, ~, ~, ~, lambda] = lsqnonneg ([1 0; 0 1; 2 1], [-1 1 -1]'); assert (x
.* lambda, [0 0]')
[x, ~, ~, ~, ~, lambda] = lsqnonneg ([1 0; 0 1; 2 1], [-1 -1 -3]'); assert (x
.* lambda, [0 0]')
[x, ~, ~, ~, lambda] = pqpnonneg ([3 2; 2 2], [6; 5]); assert (x
.* lambda, [0 0]')
[x, ~, ~, ~, lambda] = pqpnonneg ([3 2; 2 2], [6; -5]); assert (x
.* lambda, [0 0]')
[x, ~, ~, ~, lambda] = pqpnonneg ([3 2; 2 2], [-6; 5]); assert (x
.* lambda, [0 0]')
[x, ~, ~, ~, lambda] = pqpnonneg ([3 2; 2 2], [-6; -5]); assert (x
.* lambda, [0 0]')
I have a fix for this bug, along with docstring updates and BISTs, which I
will upload once I get a bug number.
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?63178>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
- [Octave-bug-tracker] [bug #63178] Incorrect lambda for lsqnonneg and pqpnonneg,
Arun Giridhar <=