From: Etienne G. <et...@is...> - 2003-02-26 12:44:15
|
Hello, use octave 2.1.XX. I am not sure whether bfgs() is meant to work with octave 2.0.XX. With 2.1.44, sincn (bfgs('sincn', [0.1 0.1 0.1]')) yields -0.21723, which seems to be the minimum of 'sincn'. Note that "sincn" has non isolated minima and that bfgs() looks for a local minimum. On Wed, Feb 26, 2003 at 08:02:13AM -0300, nwe...@ce... wrote: # well, sorry, but 'prod' converges with X0 = [0.1 0.1], and I didn't test # other points... This is a glitch in the bfgs() algorithm. If started from any_value*ones(1,N), it will go straight down to something near zero. Once there, it sees the derivative is zero and calls it a stop. This has to do with the way line minimization is done. Should fix. Hth, Etienne # sincn is defined this way: # # function r = sincn(X) # n = norm(X); # r = sin(n+0.00001)/n; # return # # I can always minimize it to something (local minima) with two points, # but that weird error occurs with more. # # I'm moving to the bleeding-edgre development version since it seems that # a lot has changed recentely in the optimization functions... but the help # from bfgs and dfp in this version does say that it works for more variables... # # # # On Wed, Feb 26, 2003 at 08:35:47AM +0000, Etienne Grossmann wrote: # > On Tue, Feb 25, 2003 at 07:10:19PM -0300, nwe...@ce... wrote: # > # it's a function that receives a list and give a real number. # > ^ # > vector # > # > # bfgs('prod', [0.1 0.1 0.1]') gives the same error. # > # > :-) . You expect a minimum at a finite point? # > # > Cheers, # > # > Etienne # > # > # # > # On Tue, Feb 25, 2003 at 08:40:46PM +0000, Etienne Grossmann wrote: # > # > # > # > Hi, # > # > # > # > what is 'sincn'? # > # > # > # > Etienne # > # > # > # > On Tue, Feb 25, 2003 at 03:21:04PM -0300, nwe...@ce... wrote: # > # > # hello, I'm trying to use the non-liear multivariable optimization # > # > # functions, but they doesn't work for more than 2 variables!... # > # > # # > # > # octave2.1:5> bfgs('sincn', [0.1 0.1]') # > # > # ans = # > # > # # > # > # 3.1773 # > # > # 3.1773 # > # > # # > # > # octave2.1:6> bfgs('sincn', [0.1 0.1 0.1]') # > # > # error: invalid vector index = 3 # > # > # error: evaluating assignment expression near line 58, column 14 # > # > # error: evaluating for command near line 56, column 5 # > # > # error: evaluating if command near line 55, column 3 # > # > # error: called from `bs_gradient' in file # > # > # `/usr/share/octave/2.1.35/site/m/octave-forge/optim/bs_gradient.m' # > # > # error: called from `bfgs' in file # > # > # `/usr/share/octave/2.1.35/site/m/octave-forge/optim/bfgs.m' # > # > # # > # > # # > # > # what am I doing wrong?!?! :/ # > # > # # > # > # ++Nicolau; -- Etienne Grossmann ------ http://www.isr.ist.utl.pt/~etienne |