octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #54420] fminsearch innacuracy


From: Arnaud Delorme
Subject: [Octave-bug-tracker] [bug #54420] fminsearch innacuracy
Date: Wed, 1 Aug 2018 13:39:35 -0400 (EDT)
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.75 Safari/537.36

URL:
  <http://savannah.gnu.org/bugs/?54420>

                 Summary: fminsearch innacuracy
                 Project: GNU Octave
            Submitted by: arnodelorme
            Submitted on: Wed 01 Aug 2018 05:39:33 PM UTC
                Category: Octave Function
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Matlab Compatibility
                  Status: None
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 4.4.0
        Operating System: Mac OS

    _______________________________________________________

Details:

This call

newcenter = fminsearch(@(center,x,y,z)std(sqrt((x - center(1)).^2+(y -
center(2)).^2+(z -
center(3)).^2)-mean(x+y+z-center(1)-center(2)-center(3))),[0 0
0],struct('MaxFunEvals',[3000]),[0;2;0],[1.95;0;0],[0;0;2])

returns under Matlab

0.0149   -0.0354    0.0149

And, under Octave 4.4.0 (after running pkg install -forge optim) returns 

0.10107   0.05302   0.10107

The local minimum is consistency different. The Matlab function has been
returning the same values since Matlab 5.3 (up to 2018a tested above).

--- further investigation

wobble = @(center,x,y,z)std(sqrt((x - center(1)).^2+(y - center(2)).^2+(z -
center(3)).^2)-mean(x+y+z-center(1)-center(2)-center(3)));

wobble(newcenter,[0;2;0],[1.95;0;0],[0;0;2])

returns 1.9971e-05 under Matlab
returns 0.00000018495 under Octave so the Octave error is lower

Not that anything should be changed after further inspection but it is worth
documenting that the fminsearch function is performing better in Octave than
in Matlab one in this specific instance.

It also points to the fact that different algorithms are used by default.
Changing the number of iterations in Matlab does not change the function
output.

Arno





    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?54420>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]