octave-maintainers
[Top][All Lists]
Advanced

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

bfgsmin and fminunc


From: Michael Creel
Subject: bfgsmin and fminunc
Date: Thu, 14 May 2009 02:08:04 -0700 (PDT)

I hadn't been keeping up with the developments, but a post today brought
fminunc to my attention. fminunc has more or less the same use as bfgsmin,
so I did a quick comparison. The script attached to this message uses the
two algorithms to minimize a function of 20 variables. If you run this on
Octave 3.1.55, you find that bfgsmin is about 7X faster. The default
tolerances for bfgsmin are 1e-12 on the function value, and 1e-6 for the
variables. For fminunc, the default tolerances according to the help entry
are 1e-7. In spite of this, a convergence check fails for fminunc (and
inspection of the result shows that some variables are more than 1e-6 away
from the solution. The output of the script is below.

This is just one example
http://www.nabble.com/file/p23536892/compare_bfgsmin_fminunc.m
compare_bfgsmin_fminunc.m , I have no idea if these results are
representative.

Michael



octave:12> compare_bfgsmin_fminunc
EXAMPLE 1: Ordinary BFGS, using analytic gradient
------------------------------------------------ 
bfgsmin final results: 65 iterations             

function value: 1.8134e-16

STRONG CONVERGENCE
Function conv 1  Param conv 1  Gradient conv 1

          param    gradient (n)          change
        0.05000        -0.00000         0.00000
        0.10000         0.00000        -0.00000
        0.15000         0.00000        -0.00000
        0.20000        -0.00000         0.00000
        0.25000        -0.00000         0.00000
        0.30000        -0.00000         0.00000
        0.35000        -0.00000         0.00000
        0.40000        -0.00000         0.00000
        0.45000         0.00000        -0.00000
        0.50000        -0.00000        -0.00000
        0.55000         0.00000        -0.00000
        0.60000        -0.00000        -0.00000
        0.65000        -0.00000         0.00000
        0.70000         0.00000        -0.00000
        0.75000         0.00000        -0.00000
        0.80000        -0.00000         0.00000
        0.85000         0.00000         0.00000
        0.90000         0.00000         0.00000
        0.95000        -0.00000         0.00000
        1.00000        -0.00000         0.00000
theta =

   0.050000
   0.100000
   0.150000
   0.200000
   0.250000
   0.300000
   0.350000
   0.400000
   0.450000
   0.500000
   0.550000
   0.600000
   0.650000
   0.700000
   0.750000
   0.799999
   0.849999
   0.899997
   0.949994
   0.999988

BFGSMIN: EXAMPLE 1: Ordinary BFGS, using analytic gradient
Success!! :-)
Elapsed time = 0.092005



FMINUNC: EXAMPLE 1: Ordinary BFGS, using analytic gradient
Failure?! :-(
Elapsed time = 0.724046

-- 
View this message in context: 
http://www.nabble.com/bfgsmin-and-fminunc-tp23536892p23536892.html
Sent from the Octave - Maintainers mailing list archive at Nabble.com.



reply via email to

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