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

 
 

bug #57982: [octave forge] (optim) error message in nonlin_min for a simple problem

Submitted by:  deego <deego>
Submitted on:  Tue 10 Mar 2020 08:47:44 PM UTC  
 
Category:  Octave Forge Package Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Regression
Status:  Confirmed Assigned to:  None
Originator Name:  deego Open/Closed:  Open
Release:  6.0.90 Operating System:  GNU/Linux

Add a New Comment (Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Sat 06 Jun 2020 07:26:15 PM UTC, comment #5: 

I confirm the original problem. I'll still investigate, but it's possible that the problem is just a weakness of the used algorithm, not a real bug (admittedly the error could be handled better, though). 'nonlin_min' is a frontend, by which you even can access sqp of Octave core, which seems to solve the example.
(A side note: in practice, the 'sum=1' constraint should be specified as a linear constraint. This should be easier for any algorithm.)

The later posts of this thread are not related to the original problem, but confirm a different error, mentioned as a side note in the original post.

Olaf Till <i7tiol>
Project Member
Tue 07 Apr 2020 11:57:38 AM UTC, comment #4: 

I don't have a fix or workaround, I just wanted to point out that this is related to bug #57199 and the issue is still not resolved.

Anonymous
Sun 29 Mar 2020 04:39:26 PM UTC, comment #3: 

With Octave 7.0

  • optim-1.60 builds with no errors, but fails tests
  • optim-1.5.3 fails to build
  • optim-1.5.1 fails to build
Carlo de Falco <cdf>
Project Member
Thu 26 Mar 2020 09:52:48 AM UTC, comment #2: 

The same test works with version 1.5.1 of the package
(need to run it manually as there are no tests in 1.5.1):

## independents
indep = 1:5;
## objective function:
f = @ (p) sumsq (p(1) * exp (p(2) * indep) - [1, 2, 4, 7, 14]);
## initial values:
init = [.25; .25];
## linear constraints, A.' * parametervector + B >= 0
A = [1; -1]; B = 0; # p(1) >= p(2);
settings = optimset ("inequc", {A, B});

assert (nonlin_min (f, init, settings), [.6203; .6203], .0001);

so I am marking this as a regression.

Carlo de Falco <cdf>
Project Member
Thu 26 Mar 2020 09:22:00 AM UTC, comment #1: 

The same error occurs on the 6.0 branch,
invoking any test in any nonlin* function from the
'optim' package, e.g. :

>> test nonlin_min
***** test
## independents
indep = 1:5;
## objective function:
f = @ (p) sumsq (p(1) * exp (p(2) * indep) - [1, 2, 4, 7, 14]);
## initial values:
init = [.25; .25];
## linear constraints, A.' * parametervector + B >= 0
A = [1; -1]; B = 0; # p(1) >= p(2);
settings = optimset ("inequc", {A, B});

assert (nonlin_min (f, init, settings), [.6203; .6203], .0001);
!!!!! test failed
'fname' undefined near line 121, column 121
>>

The same behaviour occurs also with optim downloaded from
the source repository

Carlo de Falco <cdf>
Project Member
Tue 10 Mar 2020 08:47:44 PM UTC, original submission:  

## nonlin_min errors out with a strange warning:

## 20200310 A simple optimization problem where positive coefficients X's should sum to 1.

## some numbers:
quanta = [-383 -356];
HEAT = [7 7; 6 6];

## A simple quadratic function.
objf = @(X) (X' * (HEAT * X)   - quanta * X);

constf = @(X) (sum(X)-1); ## constraint: X's should sum to 1.

starter = [0.5; 0.5];  ubound =[1; 1]; lbound = [0; 0];

## Impose the constraints:
opt = optimset("lbound", lbound, "ubound", ubound, "equc", {constf});

results = nonlin_min (objf, starter, opt);

## Produces this weird error:
## ## error: pivot is zero
## error: called from
##     gjp at line 42 column 5
##     cpiv_bard at line 76 column 4
##     _lm_feasible_ at line 302 column 31
##     nonlin_min at line 531 column 24

## Octave 5.2.0 (from compiled source) with pkg install optim -forge, on debian 10.


## Thanks to mtmiller on #octave for reproducing. He also gets the same error with 5.2.0.
## But, with 6.0.1alpha, he gets:

## >> testscript
## error: 'fname' undefined near line 121, column 121
## error: called from
##     _jacobian_constants_>@<anonymous> at line 121 column 11
##     _lm_feasible_ at line 145 column 8
##     nonlin_min at line 531 column 24
##     testscript at line 20 column 5

deego <deego>

 

(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 i7tiol (Posted a comment)
  • -email is unavailable- added by cdf (Posted a comment)
  • -email is unavailable- added by deego (Submitted the item)
  • -email is unavailable- added by deego
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

     

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-03-26 cdf Item GroupNone => Regression
    2020-03-26 cdf Release5.2.0 => 6.0.90
    2020-03-10 mtmiller StatusNone => Confirmed
        SummaryStrange error message in nonlin_min for a simple problem: => [octave forge] (optim) error message in nonlin_min for a simple problem
    2020-03-10 deego Carbon-Copy- => Added deego3@gmail.com

    Back to the top


    Powered by Savane 3.5