bugGNU Octave - Bugs: bug #60208, [octave forge] (optim) lsqnonlin...

 
 

bug #60208: [octave forge] (optim) lsqnonlin error when outputfcn terminates algorithm

Submitter:  None
Submitted:  Wed 10 Mar 2021 03:58:39 PM UTC
   
 
Category:  Octave Package Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Unexpected Error or Warning
Status:  Fixed Assigned to:  i7tiol
Originator Name:  Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * 6.2.0
Operating System:  * Any Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 11 Mar 2021 07:33:36 AM UTC, comment #2: 

Hi,
thanks! The patch works fine for me.

Anonymous
Wed 10 Mar 2021 07:13:27 PM UTC, comment #1: 

'nonlin_residmin()' hasn't set lambda in its output if it is interrupted by user interaction before it has finished optimization.

The patch

https://sourceforge.net/p/octave/optim/ci/8ee59b20dd1c0976e67e66ddeb1a67a505eedc28/

lets 'lsqnonlin()' (and 'lsqcurvefit()') check if lambda is set. If you can build the package from the repository, you could check if this change works for you (I haven't tested it).

A workaround would be to use 'nonlin_residmin()' directly and 'residmin_stat()' for the Jacobian.

Olaf Till <i7tiol>
Group Member
Wed 10 Mar 2021 03:58:39 PM UTC, original submission:  

Hello,

I've added an output function to stop lsqnonlin for a specific condition. For stop=true I'm getting the error


error: rmfield: structure does not contain field lambda
error: called from
    lsqnonlin at line 282 column 10


for some inputs. I've looked into the outp variable and sometimes it's simply missing the "lambda" field.
One of my outputs from lsqnonlin is also the jacobian; in the stop=true case, same thing happens in lines 290/291 because residmin_out{4} doesn't contain a "lambda" field.

This happens in both Octave 6.2 and an older dev branch version (May 2020), with optim package versions 1.6.0 and 1.6.1.

I'm pretty sure this is an actual bug, the question is just whether/how it depends on the actual input/optimisation values. I haven't included a minimal example because I'm not quite sure how to replicate the bug without attaching half of our other project code...

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by siko1056 (Updated the item)
  • -email is unavailable- added by i7tiol (Posted a comment)
  • -email is unavailable- added by None (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-03-12 i7tiol StatusReady For Test Fixed
        Open/ClosedOpen Closed
    2021-03-11 siko1056 Summary(optim) lsqnonlin error when outputfcn terminates algorithm [octave forge] (optim) lsqnonlin error when outputfcn terminates algorithm
    2021-03-10 i7tiol StatusNone Ready For Test
        Assigned toNone i7tiol

    Back to the top

    Powered by Savane 3.13-4b48.
    Corresponding source code