~ubuntu-branches/debian/squeeze/maxima/squeeze

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
@menu
* Introduction to lbfgs::
* Functions and Variables for lbfgs::
@end menu

@node Introduction to lbfgs, Functions and Variables for lbfgs, Top, Top
@section Introduction to lbfgs

@code{lbfgs} is an implementation of the L-BFGS algorithm [1]
to solve unconstrained minimization problems via a limited-memory quasi-Newton (BFGS) algorithm.
It is called a limited-memory method because a low-rank approximation of the
Hessian matrix inverse is stored instead of the entire Hessian inverse.
The program was originally written in Fortran [2] by Jorge Nocedal,
incorporating some functions originally written by Jorge J. Mor@'{e} and David J. Thuente,
and translated into Lisp automatically via the program @code{f2cl}.
The Maxima package @code{lbfgs} comprises the translated code plus
an interface function which manages some details.

References:

[1] D. Liu and J. Nocedal. "On the limited memory BFGS method for large
scale optimization". @i{Mathematical Programming B} 45:503--528 (1989)

[2] @url{http://netlib.org/opt/lbfgs_um.shar}

@opencatbox
@category{Numerical methods} @category{Share packages} @category{Package lbfgs}
@closecatbox

@node Functions and Variables for lbfgs, , Introduction to lbfgs, Top
@section Functions and Variables for lbfgs

@deffn {Function} lbfgs (@var{FOM}, @var{X}, @var{X0}, @var{epsilon}, @var{iprint})
@deffnx {Function} lbfgs ([@var{FOM}, @var{grad}] @var{X}, @var{X0}, @var{epsilon}, @var{iprint})

Finds an approximate solution of the unconstrained minimization of the figure of merit @var{FOM}
over the list of variables @var{X},
starting from initial estimates @var{X0},
such that @math{norm(grad(FOM)) < epsilon*max(1, norm(X))}.

@var{grad}, if present, is the gradient of @var{FOM} with respect to the variables @var{X}.
@var{grad} is a list, with one element for each element of @var{X}.
If not present, the gradient is computed automatically by symbolic differentiation.

The algorithm applied is a limited-memory quasi-Newton (BFGS) algorithm [1].
It is called a limited-memory method because a low-rank approximation of the
Hessian matrix inverse is stored instead of the entire Hessian inverse.
Each iteration of the algorithm is a line search, that is,
a search along a ray in the variables @var{X},
with the search direction computed from the approximate Hessian inverse.
The FOM is always decreased by a successful line search.
Usually (but not always) the norm of the gradient of FOM also decreases.

@var{iprint} controls progress messages printed by @code{lbfgs}.

@table @code
@item iprint[1]
@code{@var{iprint}[1]} controls the frequency of progress messages.
@table @code
@item iprint[1] < 0
No progress messages.
@item iprint[1] = 0
Messages at the first and last iterations.
@item iprint[1] > 0
Print a message every @code{@var{iprint}[1]} iterations.
@end table
@item iprint[2]
@code{@var{iprint}[2]} controls the verbosity of progress messages.
@table @code
@item iprint[2] = 0
Print out iteration count, number of evaluations of @var{FOM}, value of @var{FOM},
norm of the gradient of @var{FOM}, and step length.
@item iprint[2] = 1
Same as @code{@var{iprint}[2] = 0}, plus @var{X0} and the gradient of @var{FOM} evaluated at @var{X0}.
@item iprint[2] = 2
Same as @code{@var{iprint}[2] = 1}, plus values of @var{X} at each iteration.
@item iprint[2] = 3
Same as @code{@var{iprint}[2] = 2}, plus the gradient of @var{FOM} at each iteration.
@end table
@end table

The columns printed by @code{lbfgs} are the following.

@table @code
@item I
Number of iterations. It is incremented for each line search.
@item NFN
Number of evaluations of the figure of merit.
@item FUNC
Value of the figure of merit at the end of the most recent line search.
@item GNORM
Norm of the gradient of the figure of merit at the end of the most recent line search.
@item STEPLENGTH
An internal parameter of the search algorithm.
@end table

Additional information concerning details of the algorithm are found in the
comments of the original Fortran code [2].

See also @code{lbfgs_nfeval_max} and @code{lbfgs_ncorrections}.

References:

[1] D. Liu and J. Nocedal. "On the limited memory BFGS method for large
scale optimization". @i{Mathematical Programming B} 45:503--528 (1989)

[2] @url{http://netlib.org/opt/lbfgs_um.shar}

Examples:

The same FOM as computed by FGCOMPUTE in the program sdrive.f in the LBFGS package from Netlib.
Note that the variables in question are subscripted variables.
The FOM has an exact minimum equal to zero at @math{u[k] = 1} for @math{k = 1, ..., 8}.
@c ===beg===
@c load (lbfgs);
@c t1[j] := 1 - u[j];
@c t2[j] := 10*(u[j + 1] - u[j]^2);
@c n : 8;
@c FOM : sum (t1[2*j - 1]^2 + t2[2*j - 1]^2, j, 1, n/2);
@c lbfgs (FOM, '[u[1], u[2], u[3], u[4], u[5], u[6], u[7], u[8]],
@c        [-1.2, 1, -1.2, 1, -1.2, 1, -1.2, 1], 1e-3, [1, 0]);
@c ===end===

@example
(%i1) load (lbfgs);
(%o1)   /usr/share/maxima/5.10.0cvs/share/lbfgs/lbfgs.mac
(%i2) t1[j] := 1 - u[j];
(%o2)                     t1  := 1 - u
                            j         j
(%i3) t2[j] := 10*(u[j + 1] - u[j]^2);
                                          2
(%o3)                t2  := 10 (u      - u )
                       j         j + 1    j
(%i4) n : 8;
(%o4)                           8
(%i5) FOM : sum (t1[2*j - 1]^2 + t2[2*j - 1]^2, j, 1, n/2);
                 2 2           2              2 2           2
(%o5) 100 (u  - u )  + (1 - u )  + 100 (u  - u )  + (1 - u )
            8    7           7           6    5           5
                     2 2           2              2 2           2
        + 100 (u  - u )  + (1 - u )  + 100 (u  - u )  + (1 - u )
                4    3           3           2    1           1
(%i6) lbfgs (FOM, '[u[1],u[2],u[3],u[4],u[5],u[6],u[7],u[8]],
       [-1.2, 1, -1.2, 1, -1.2, 1, -1.2, 1], 1e-3, [1, 0]);
*************************************************
  N=    8   NUMBER OF CORRECTIONS=25
       INITIAL VALUES
 F=  9.680000000000000D+01   GNORM=  4.657353755084532D+02
*************************************************
@end example
@ifnottex
@example
 I NFN   FUNC                    GNORM                   STEPLENGTH

 1   3   1.651479526340304D+01   4.324359291335977D+00   7.926153934390631D-04
 2   4   1.650209316638371D+01   3.575788161060007D+00   1.000000000000000D+00
 3   5   1.645461701312851D+01   6.230869903601577D+00   1.000000000000000D+00 
 4   6   1.636867301275588D+01   1.177589920974980D+01   1.000000000000000D+00
 5   7   1.612153014409201D+01   2.292797147151288D+01   1.000000000000000D+00
 6   8   1.569118407390628D+01   3.687447158775571D+01   1.000000000000000D+00
 7   9   1.510361958398942D+01   4.501931728123680D+01   1.000000000000000D+00
 8  10   1.391077875774294D+01   4.526061463810632D+01   1.000000000000000D+00
 9  11   1.165625686278198D+01   2.748348965356917D+01   1.000000000000000D+00
10  12   9.859422687859137D+00   2.111494974231644D+01   1.000000000000000D+00
11  13   7.815442521732281D+00   6.110762325766556D+00   1.000000000000000D+00
12  15   7.346380905773160D+00   2.165281166714631D+01   1.285316401779533D-01
13  16   6.330460634066370D+00   1.401220851762050D+01   1.000000000000000D+00
14  17   5.238763939851439D+00   1.702473787613255D+01   1.000000000000000D+00
15  18   3.754016790406701D+00   7.981845727704576D+00   1.000000000000000D+00
16  20   3.001238402309352D+00   3.925482944716691D+00   2.333129631296807D-01
17  22   2.794390709718290D+00   8.243329982546473D+00   2.503577283782332D-01
18  23   2.563783562918759D+00   1.035413426521790D+01   1.000000000000000D+00
19  24   2.019429976377856D+00   1.065187312346769D+01   1.000000000000000D+00
20  25   1.428003167670903D+00   2.475962450826961D+00   1.000000000000000D+00
21  27   1.197874264861340D+00   8.441707983493810D+00   4.303451060808756D-01
22  28   9.023848941942773D-01   1.113189216635162D+01   1.000000000000000D+00
23  29   5.508226405863770D-01   2.380830600326308D+00   1.000000000000000D+00
24  31   3.902893258815567D-01   5.625595816584421D+00   4.834988416524465D-01
25  32   3.207542206990315D-01   1.149444645416472D+01   1.000000000000000D+00
26  33   1.874468266362791D-01   3.632482152880997D+00   1.000000000000000D+00
27  34   9.575763380706598D-02   4.816497446154354D+00   1.000000000000000D+00
28  35   4.085145107543406D-02   2.087009350166495D+00   1.000000000000000D+00
29  36   1.931106001379290D-02   3.886818608498966D+00   1.000000000000000D+00
30  37   6.894000721499670D-03   3.198505796342214D+00   1.000000000000000D+00
31  38   1.443296033051864D-03   1.590265471025043D+00   1.000000000000000D+00
32  39   1.571766603154336D-04   3.098257063980634D-01   1.000000000000000D+00
33  40   1.288011776581970D-05   1.207784183577257D-02   1.000000000000000D+00
34  41   1.806140173752971D-06   4.587890233385193D-02   1.000000000000000D+00
35  42   1.769004645459358D-07   1.790537375052208D-02   1.000000000000000D+00
36  43   3.312164100763217D-10   6.782068426119681D-04   1.000000000000000D+00
@end example
@end ifnottex
@tex
\halign{\hfil\tt#&\quad\hfil\tt#\quad&\tt#\hfil\quad&\tt#\hfil\quad&\tt#\hfil\cr
I& NFN&   FUNC&                    GNORM&                   STEPLENGTH\cr
&&&&\cr
 1& 3& 1.651479526340304D+01& 4.324359291335977D+00& 7.926153934390631D-04\cr
 2& 4& 1.650209316638371D+01& 3.575788161060007D+00& 1.000000000000000D+00\cr
 3& 5& 1.645461701312851D+01& 6.230869903601577D+00& 1.000000000000000D+00\cr
 4& 6& 1.636867301275588D+01& 1.177589920974980D+01& 1.000000000000000D+00\cr
 5& 7& 1.612153014409201D+01& 2.292797147151288D+01& 1.000000000000000D+00\cr
 6& 8& 1.569118407390628D+01& 3.687447158775571D+01& 1.000000000000000D+00\cr
 7& 9& 1.510361958398942D+01& 4.501931728123680D+01& 1.000000000000000D+00\cr
 8&10& 1.391077875774294D+01& 4.526061463810632D+01& 1.000000000000000D+00\cr
 9&11& 1.165625686278198D+01& 2.748348965356917D+01& 1.000000000000000D+00\cr
10&12& 9.859422687859137D+00& 2.111494974231644D+01& 1.000000000000000D+00\cr
11&13& 7.815442521732281D+00& 6.110762325766556D+00& 1.000000000000000D+00\cr
12&15& 7.346380905773160D+00& 2.165281166714631D+01& 1.285316401779533D-01\cr
13&16& 6.330460634066370D+00& 1.401220851762050D+01& 1.000000000000000D+00\cr
14&17& 5.238763939851439D+00& 1.702473787613255D+01& 1.000000000000000D+00\cr
15&18& 3.754016790406701D+00& 7.981845727704576D+00& 1.000000000000000D+00\cr
16&20& 3.001238402309352D+00& 3.925482944716691D+00& 2.333129631296807D-01\cr
17&22& 2.794390709718290D+00& 8.243329982546473D+00& 2.503577283782332D-01\cr
18&23& 2.563783562918759D+00& 1.035413426521790D+01& 1.000000000000000D+00\cr
19&24& 2.019429976377856D+00& 1.065187312346769D+01& 1.000000000000000D+00\cr
20&25& 1.428003167670903D+00& 2.475962450826961D+00& 1.000000000000000D+00\cr
21&27& 1.197874264861340D+00& 8.441707983493810D+00& 4.303451060808756D-01\cr
22&28& 9.023848941942773D-01& 1.113189216635162D+01& 1.000000000000000D+00\cr
23&29& 5.508226405863770D-01& 2.380830600326308D+00& 1.000000000000000D+00\cr
24&31& 3.902893258815567D-01& 5.625595816584421D+00& 4.834988416524465D-01\cr
25&32& 3.207542206990315D-01& 1.149444645416472D+01& 1.000000000000000D+00\cr
26&33& 1.874468266362791D-01& 3.632482152880997D+00& 1.000000000000000D+00\cr
27&34& 9.575763380706598D-02& 4.816497446154354D+00& 1.000000000000000D+00\cr
28&35& 4.085145107543406D-02& 2.087009350166495D+00& 1.000000000000000D+00\cr
29&36& 1.931106001379290D-02& 3.886818608498966D+00& 1.000000000000000D+00\cr
30&37& 6.894000721499670D-03& 3.198505796342214D+00& 1.000000000000000D+00\cr
31&38& 1.443296033051864D-03& 1.590265471025043D+00& 1.000000000000000D+00\cr
32&39& 1.571766603154336D-04& 3.098257063980634D-01& 1.000000000000000D+00\cr
33&40& 1.288011776581970D-05& 1.207784183577257D-02& 1.000000000000000D+00\cr
34&41& 1.806140173752971D-06& 4.587890233385193D-02& 1.000000000000000D+00\cr
35&42& 1.769004645459358D-07& 1.790537375052208D-02& 1.000000000000000D+00\cr
36&43& 3.312164100763217D-10& 6.782068426119681D-04& 1.000000000000000D+00\cr
}
@end tex
@example

 THE MINIMIZATION TERMINATED WITHOUT DETECTING ERRORS.
 IFLAG = 0
(%o6) [u  = 1.000005339815974, u  = 1.000009942839805, 
        1                       2
u  = 1.000005339815974, u  = 1.000009942839805, 
 3                       4
u  = 1.000005339815974, u  = 1.000009942839805, 
 5                       6
u  = 1.000005339815974, u  = 1.000009942839805]
 7                       8
@end example

A regression problem.
The FOM is the mean square difference between the predicted value @math{F(X[i])}
and the observed value @math{Y[i]}.
The function @math{F} is a bounded monotone function (a so-called "sigmoidal" function).
In this example, @code{lbfgs} computes approximate values for the parameters of @math{F}
and @code{plot2d} displays a comparison of @math{F} with the observed data.
@c ===beg===
@c load (lbfgs);
@c FOM : '((1/length(X))*sum((F(X[i]) - Y[i])^2, i, 1, 
@c                                                 length(X)));
@c X : [1, 2, 3, 4, 5];
@c Y : [0, 0.5, 1, 1.25, 1.5];
@c F(x) := A/(1 + exp(-B*(x - C)));
@c ''FOM;
@c estimates : lbfgs (FOM, '[A, B, C], [1, 1, 1], 1e-4, [1, 0]);
@c plot2d ([F(x), [discrete, X, Y]], [x, -1, 6]), ''estimates;
@c ===end===

@example
(%i1) load (lbfgs);
(%o1)   /usr/share/maxima/5.10.0cvs/share/lbfgs/lbfgs.mac
(%i2) FOM : '((1/length(X))*sum((F(X[i]) - Y[i])^2, i, 1,
                                                length(X)));
                               2
               sum((F(X ) - Y ) , i, 1, length(X))
                       i     i
(%o2)          -----------------------------------
                            length(X)
(%i3) X : [1, 2, 3, 4, 5];
(%o3)                    [1, 2, 3, 4, 5]
(%i4) Y : [0, 0.5, 1, 1.25, 1.5];
(%o4)                [0, 0.5, 1, 1.25, 1.5]
(%i5) F(x) := A/(1 + exp(-B*(x - C)));
                                   A
(%o5)            F(x) := ----------------------
                         1 + exp((- B) (x - C))
(%i6) ''FOM;
                A               2            A                2
(%o6) ((----------------- - 1.5)  + (----------------- - 1.25)
          - B (5 - C)                  - B (4 - C)
        %e            + 1            %e            + 1
            A             2            A               2
 + (----------------- - 1)  + (----------------- - 0.5)
      - B (3 - C)                - B (2 - C)
    %e            + 1          %e            + 1
             2
            A
 + --------------------)/5
      - B (1 - C)     2
   (%e            + 1)
(%i7) estimates : lbfgs (FOM, '[A, B, C], [1, 1, 1], 1e-4, [1, 0]);
*************************************************
  N=    3   NUMBER OF CORRECTIONS=25
       INITIAL VALUES
 F=  1.348738534246918D-01   GNORM=  2.000215531936760D-01
*************************************************

@end example
@ifnottex
@example
I  NFN  FUNC                    GNORM                   STEPLENGTH
1    3  1.177820636622582D-01   9.893138394953992D-02   8.554435968992371D-01  
2    6  2.302653892214013D-02   1.180098521565904D-01   2.100000000000000D+01  
3    8  1.496348495303005D-02   9.611201567691633D-02   5.257340567840707D-01  
4    9  7.900460841091139D-03   1.325041647391314D-02   1.000000000000000D+00  
5   10  7.314495451266917D-03   1.510670810312237D-02   1.000000000000000D+00  
6   11  6.750147275936680D-03   1.914964958023047D-02   1.000000000000000D+00  
7   12  5.850716021108205D-03   1.028089194579363D-02   1.000000000000000D+00  
8   13  5.778664230657791D-03   3.676866074530332D-04   1.000000000000000D+00  
9   14  5.777818823650782D-03   3.010740179797255D-04   1.000000000000000D+00  
@end example
@end ifnottex
@tex
\halign{\hfil\tt#&\quad\hfil\tt#\quad&\tt#\hfil\quad&\tt#\hfil\quad&\tt#\hfil\cr
I& NFN&   FUNC&                    GNORM&                   STEPLENGTH\cr
&&&&\cr
1&  3&1.177820636622582D-01& 9.893138394953992D-02& 8.554435968992371D-01\cr
2&  6&2.302653892214013D-02& 1.180098521565904D-01& 2.100000000000000D+01\cr
3&  8&1.496348495303005D-02& 9.611201567691633D-02& 5.257340567840707D-01\cr
4&  9&7.900460841091139D-03& 1.325041647391314D-02& 1.000000000000000D+00\cr
5& 10&7.314495451266917D-03& 1.510670810312237D-02& 1.000000000000000D+00\cr
6& 11&6.750147275936680D-03& 1.914964958023047D-02& 1.000000000000000D+00\cr
7& 12&5.850716021108205D-03& 1.028089194579363D-02& 1.000000000000000D+00\cr
8& 13&5.778664230657791D-03& 3.676866074530332D-04& 1.000000000000000D+00\cr
9& 14&5.777818823650782D-03& 3.010740179797255D-04& 1.000000000000000D+00\cr
}
@end tex
@example

 THE MINIMIZATION TERMINATED WITHOUT DETECTING ERRORS.
 IFLAG = 0
(%o7) [A = 1.461933911464101, B = 1.601593973254802, 
                                           C = 2.528933072164854]
(%i8) plot2d ([F(x), [discrete, X, Y]], [x, -1, 6]), ''estimates;
(%o8) 
@end example

Gradient of FOM is specified (instead of computing it automatically).

@c ===beg===
@c load (lbfgs)$
@c F(a, b, c) := (a - 5)^2 + (b - 3)^4 + (c - 2)^6;
@c F_grad : map (lambda ([x], diff (F(a, b, c), x)), [a, b, c]);
@c estimates : lbfgs ([F(a, b, c), F_grad], [a, b, c], [0, 0, 0], 1e-4, [1, 0]);
@c ===end===
@example
(%i1) load (lbfgs)$
(%i2) F(a, b, c) := (a - 5)^2 + (b - 3)^4 + (c - 2)^6;
                               2          4          6
(%o2)     F(a, b, c) := (a - 5)  + (b - 3)  + (c - 2)
(%i3) F_grad : map (lambda ([x], diff (F(a, b, c), x)), [a, b, c]);
                                    3           5
(%o3)          [2 (a - 5), 4 (b - 3) , 6 (c - 2) ]
(%i4) estimates : lbfgs ([F(a, b, c), F_grad], [a, b, c], [0, 0, 0], 1e-4, [1, 0]);
*************************************************
  N=    3   NUMBER OF CORRECTIONS=25
       INITIAL VALUES
 F=  1.700000000000000D+02   GNORM=  2.205175729958953D+02
*************************************************

@end example
@ifnottex
@example
   I  NFN     FUNC                    GNORM                   STEPLENGTH

   1    2     6.632967565917638D+01   6.498411132518770D+01   4.534785987412505D-03  
   2    3     4.368890936228036D+01   3.784147651974131D+01   1.000000000000000D+00  
   3    4     2.685298972775190D+01   1.640262125898521D+01   1.000000000000000D+00  
   4    5     1.909064767659852D+01   9.733664001790506D+00   1.000000000000000D+00  
   5    6     1.006493272061515D+01   6.344808151880209D+00   1.000000000000000D+00  
   6    7     1.215263596054294D+00   2.204727876126879D+00   1.000000000000000D+00  
   7    8     1.080252896385334D-02   1.431637116951849D-01   1.000000000000000D+00  
   8    9     8.407195124830908D-03   1.126344579730013D-01   1.000000000000000D+00  
   9   10     5.022091686198527D-03   7.750731829225274D-02   1.000000000000000D+00  
  10   11     2.277152808939775D-03   5.032810859286795D-02   1.000000000000000D+00  
  11   12     6.489384688303218D-04   1.932007150271008D-02   1.000000000000000D+00  
  12   13     2.075791943844548D-04   6.964319310814364D-03   1.000000000000000D+00  
  13   14     7.349472666162257D-05   4.017449067849554D-03   1.000000000000000D+00  
  14   15     2.293617477985237D-05   1.334590390856715D-03   1.000000000000000D+00  
  15   16     7.683645404048675D-06   6.011057038099201D-04   1.000000000000000D+00  
@end example
@end ifnottex
@tex
\halign{\hfil\tt#&\quad\hfil\tt#\quad&\tt#\hfil\quad&\tt#\hfil\quad&\tt#\hfil\cr
I& NFN&   FUNC&                    GNORM&                   STEPLENGTH\cr
&&&&\cr
   1&   2&    6.632967565917638D+01&  6.498411132518770D+01&  4.534785987412505D-03\cr
   2&   3&    4.368890936228036D+01&  3.784147651974131D+01&  1.000000000000000D+00\cr
   3&   4&    2.685298972775190D+01&  1.640262125898521D+01&  1.000000000000000D+00\cr
   4&   5&    1.909064767659852D+01&  9.733664001790506D+00&  1.000000000000000D+00\cr
   5&   6&    1.006493272061515D+01&  6.344808151880209D+00&  1.000000000000000D+00\cr
   6&   7&    1.215263596054294D+00&  2.204727876126879D+00&  1.000000000000000D+00\cr
   7&   8&    1.080252896385334D-02&  1.431637116951849D-01&  1.000000000000000D+00\cr
   8&   9&    8.407195124830908D-03&  1.126344579730013D-01&  1.000000000000000D+00\cr
   9&  10&    5.022091686198527D-03&  7.750731829225274D-02&  1.000000000000000D+00\cr
  10&  11&    2.277152808939775D-03&  5.032810859286795D-02&  1.000000000000000D+00\cr
  11&  12&    6.489384688303218D-04&  1.932007150271008D-02&  1.000000000000000D+00\cr
  12&  13&    2.075791943844548D-04&  6.964319310814364D-03&  1.000000000000000D+00\cr
  13&  14&    7.349472666162257D-05&  4.017449067849554D-03&  1.000000000000000D+00\cr
  14&  15&    2.293617477985237D-05&  1.334590390856715D-03&  1.000000000000000D+00\cr
  15&  16&    7.683645404048675D-06&  6.011057038099201D-04&  1.000000000000000D+00\cr
}
@end tex
@example

 THE MINIMIZATION TERMINATED WITHOUT DETECTING ERRORS.
 IFLAG = 0
(%o4) [a = 5.000086823042934, b = 3.05239542970518, 
                                           c = 1.927980629919583]
@end example

@opencatbox
@category{Package lbfgs}
@closecatbox

@end deffn

@defvr {Variable} lbfgs_nfeval_max
Default value: 100

@code{lbfgs_nfeval_max} is the maximum number of evaluations of the figure of merit (FOM) in @code{lbfgs}.
When @code{lbfgs_nfeval_max} is reached,
@code{lbfgs} returns the result of the last successful line search.

@opencatbox
@category{Package lbfgs}
@closecatbox

@end defvr

@defvr {Variable} lbfgs_ncorrections
Default value: 25

@code{lbfgs_ncorrections} is the number of corrections applied
to the approximate inverse Hessian matrix which is maintained by @code{lbfgs}.

@opencatbox
@category{Package lbfgs}
@closecatbox

@end defvr