bugGNU Octave - Bugs: bug #47363, nonlin_residmin: precision? ...

 
 

bug #47363: nonlin_residmin: precision? ("optim" package)

Submitted by:  None
Submitted on:  Tue 08 Mar 2016 03:56:40 PM UTC  
 
Category: Octave Forge PackageSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Inaccurate Result
Status: Wont FixAssigned to: None
Originator Name: MichaelOriginator Email: -unavailable-
Open/Closed: ClosedRelease: 4.0.0
Operating System: Microsoft Windows

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Tue 29 Mar 2016 12:38:27 PM UTC, comment #4:

Hello,

I agree that this example is somewhat artificial. I just wanted to know what the problem could be or if the observed result is part of greater issue/bug.

Thank you for your reply!

Anonymous
Fri 25 Mar 2016 03:41:37 PM UTC, comment #3:

Marking as "won't fix" and closing based on Olaf's last comment. This can be changed later or reported again if other related problems appear.

Mike Miller <mtmiller>
Project Administrator
Fri 25 Mar 2016 03:29:35 PM UTC, comment #2:

Thinking again, I'd say that I won't add smaller step sizes even in the first iteration. The reason is that your example behaves opposite to usual cases of real residual minimization, where the gradient gets smaller the nearer the parameters get to a minimum. If step sizes should be a problem in some real residual minimization example, we'd have to think about this again.

Olaf Till <i7tiol>
Project Member
Fri 25 Mar 2016 02:45:14 PM UTC, comment #1:

> What I am wondering about is if nonlin_residmin already has
> problems because of the gradient at 1.0001 being close to zero?


It seems so.

> One would expect that 1e-5 should not be an issue in terms of
> machine precision?


This has nothing to do with machine precision.

If you run with 'optimset ("debug", true)', you see that the low gradient makes the algorithm try steps of which even the smallest is too large.

I wouldn't consider this a real bug, since your example is a bit artificial, and for real world examples usually the chosen step sizes (for more than 1 parameter this also affects step direction) work quite well. But maybe in the first iteration, where choosing step sizes is more arbitrary, a few more small step sizes should be tried. I'll keep this in mind.

Olaf Till <i7tiol>
Project Member
Tue 08 Mar 2016 03:56:40 PM UTC, original submission:

Hello,

I tinkered with the nonlin_residmin function from the "optim" package. My goal was to find the roots of a simple function; f(x) = x^2-2*x-5

Since nonlin-residmin uses residual minimisation, I did not define a cost function and just defined f(x) as:

function out = f(x)
out = x^2-2*x-5;
endfunction

1. One root of this function is at approx. x_root = 3.45, while its absolute minimum is located at x_min = 1. When using x0=1.1 as a starting point, nonlin_residmin finds the actual root at 3.45 (since the residual is almost zero in this place).

2. When I use 1.0001 as the starting point, the residual shown is 6. However this is f(x_min) and therefore the absolute minimum of the function but not even close to either of the roots.

What I am wondering about is if nonlin_residmin already has problems because of the gradient at 1.0001 being close to zero? One would expect that 1e-5 should not be an issue in terms of machine precision?

An example file is attached to this post. I am running Octave 4.0.0 on 64bit Windows 7.

Anonymous

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #36571:  test.m added by None (390B - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by mtmiller (Posted a comment)
  • -unavailable- added by i7tiol (Posted a comment)
  •  

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

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 25 Mar 2016 03:41:37 PM UTCmtmillerStatusNone=>Wont Fix
      Open/ClosedOpen=>Closed
    Tue 08 Mar 2016 03:56:40 PM UTCNoneAttached File-=>Added test.m, #36571

    Back to the top


    Powered by Savane 3.1-cleanup1