bugGNU Octave - Bugs: bug #33347, lsqnonneg should have tolerance...

 
 

bug #33347: lsqnonneg should have tolerance option for convergence

Submitted by:  None
Submitted on:  Thu 19 May 2011 05:30:19 AM UTC  
 
Category: LibrariesSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Performance
Status: FixedAssigned to: None
Originator Name: Sean PieperOriginator Email: -unavailable-
Open/Closed: ClosedRelease: 3.4.0
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.

 

Thu 21 Jun 2012 03:27:28 PM UTC, comment #3:

Thanks for the patch Axel. I have applied it here (http://hg.savannah.gnu.org/hgweb/octave/rev/acb09716fc94). Marking this report as fixed and closing it. The original reporter can access the fix by building from Mercurial sources or waiting until the next stable release of Octave (3.8.0).

Rik <rik5>
Project Administrator
Thu 21 Jun 2012 10:36:27 AM UTC, comment #2:

Here is a little patch implementing this option.
Now the default tolerance value is the same as in MATLAB:

(file #26075)

Axel Mathéi <amathei>
Mon 27 Feb 2012 05:46:26 PM UTC, comment #1:

This is a good idea and probably easy to implement. The Matlab equivalent function (http://www.mathworks.com/help/techdoc/ref/lsqnonneg.html) implements a TolX option which would probably be the correct approach.

Could the reporter attempt a solution? Try looking at fzero.m for an easy way of setting the tolerance to the default or having it overriden by a supplied value.

Rik <rik5>
Project Administrator
Thu 19 May 2011 05:30:19 AM UTC, original submission:

running lsqnonneg using a matrix with a large range of exact solutions, I see that it takes about 20s to solve for points that should have 0 error and much less for points that have some error-- apparently the full 10000 iterations are used trying to get to exactly 0 distance (end result is ~10^26 distance). The worst case performance can be considerably reduced if we modify the code around here:

so that line 147 reads

Obviously, the right value for the tolerance isn't always going to be 0.001, but it should be easy enough to add a tolerance parameter to the option set, and possibly to additionally have some sort of auto tolerance calculation based on the max values of points, some static value of epsilon, etc.

Anonymous

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #26075:  lsqnonneg.patch added by amathei (2KiB - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by amathei (Updated the item)
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by None (Submitted the item)
  •  

    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 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 21 Jun 2012 03:27:28 PM UTCrik5StatusConfirmed=>Fixed
      Open/ClosedOpen=>Closed
    Thu 21 Jun 2012 10:36:26 AM UTCamatheiAttached File-=>Added lsqnonneg.patch, #26075
    Mon 27 Feb 2012 05:46:26 PM UTCrik5StatusNone=>Confirmed

    Back to the top


    Powered by Savane 3.1-cleanup1