bugGNU Octave - Bugs: bug #47369, [octave forge] (statistics) gevfit...

 
 

bug #47369: [octave forge] (statistics) gevfit malfunctioning (because of fminunc failure)

Submitted by:  Muhali <muhali>
Submitted on:  Wed 09 Mar 2016 10:20:23 AM UTC  
 
Category: Octave Forge PackageSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: NoneAssigned to: None
Originator Name: Open/Closed: Open
Release: devOperating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Wed 09 Mar 2016 08:24:57 PM UTC, comment #4:

Thanks to both, and thanks for the fix. I agree with you that one should stick to the octave core as much as possible. But if an optimization fails so gravely (see attached cdf.png) without issuing any warning, then the 'normal' user will be turned away immediately, especially since EV analysis is quite relevant.

And as mentioned, it seems (the core function) fminunc has trouble with gevlike, without throwing errors. I suspect the gradient calculation fails near the domain boundary.

(file #36587)

Muhali <muhali>
Wed 09 Mar 2016 08:02:57 PM UTC, comment #3:

Hi Muhali-- I agree with Arno that it's preferable to stick to functions in core Octave as much as possible so that Statistics doesn't require other Forge packages. It is to be expected that any optimization algorithm used in gevfit could fail to converge in some cases, because the objective function is quite nonlinear. Whether the optimization converges to a likelihood maximum or not for particular data typically depends on the initial value, which can be user-supplied or determined automatically.

In response to your problem, I improved the automatically estimated initial value so that gevfit (in the repository) now converges properly for your example with automatic choice of initial value (p = gevfit(x);). p = gevfit(x, [0 1 0]); will still not converge, but now there is a warning that the optimization didn't work.

Best, Nir

Nir Krakauer <nir_krakauer>
Wed 09 Mar 2016 06:34:50 PM UTC, comment #2:

Thanks for the bug report. However, I am reluctant to replace fminunc with nelder_mead_min (and add the optim package dependency). Which of the two optimization algorithms performs better strongly depends on the data. In this case the simplex method performed better, in other cases the gradient based method will perform better.

Arno Onken <asnelt>
Wed 09 Mar 2016 05:54:25 PM UTC, comment #1:

Adding maintainer to CC.

Carnë Draug <carandraug>
Project Member
Wed 09 Mar 2016 10:20:23 AM UTC, original submission:

With the present version of the statistics package (1.2.4), the gevfit function returns unusable results.

The reason is that fminunc fails to find an appropriate minimum, with nelder_mead_min, for example, obviously working. I actually checked the fminunc solution, and indeed the objective function decreased in the immediate eps neighborhood. So it seems that this is in fact a fminunc bug.

The failure is demonstrated by the following case:

The corresponding files are attached (with 3 lines added to gevfit that show the sub-optimal solution as compared to nelder_mead).

Muhali <muhali>

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #36587:  cdf.png added by muhali (18KiB - image/png)
file #36575:  x.ot added by muhali (208B - application/octet-stream)
file #36576:  gevfit.m added by muhali (3KiB - text/x-objcsrc)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by jwe (Updated the item)
  • -unavailable- added by nir_krakauer (Posted a comment)
  • -unavailable- added by asnelt (Posted a comment)
  • -unavailable- added by carandraug (Arno Onken - maintainer of statistics package)
  • -unavailable- added by muhali (Submitted the item)
  • -unavailable- added by muhali
  •  

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

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 13 Aug 2017 01:53:46 PM UTCjweSummarystatistics: gevfit malfunctioning (because of fminunc failure)=>[octave forge] (statistics) gevfit malfunctioning (because of fminunc failure)
    Wed 09 Mar 2016 08:24:57 PM UTCmuhaliAttached File-=>Added cdf.png, #36587
    Wed 09 Mar 2016 05:54:25 PM UTCcarandraugCarbon-Copy-=>Added -unavailable-
    Wed 09 Mar 2016 10:21:02 AM UTCmuhaliAttached File-=>Added x.ot, #36575
      Attached File-=>Added gevfit.m, #36576
    Wed 09 Mar 2016 10:20:23 AM UTCmuhaliCarbon-Copy-=>Added asnelt

    Back to the top


    Powered by Savane 3.1-cleanup1