Skip to content
Prev 138925 / 398506 Next

parameters for lbfgsb (function for optimization)

I think I did not make myself clear when I asked about lbfgsb (function for
optimization) yesterday. I'm writing my functions in C but actual
calculation will be done in R by using .Call.
To be able to use lbfgsb (using the interfaces defined in header
'R_ext/Applic.h') , I need to supply my function and gradient function. And
the instruction in R-ext.pdf (p97) says that my function should have three
parameters(int n, double *par, void *ex) and gradient function should have
four parameters(int n, double *par, double *gr, void *ex).
My question is :  what is *ex (the last parameter) for? and what values
should I put for it? How about fncount and rcount (14 and 15th parameter of
lbfgsb)? Thank you in advance.
Kyeongmi
Bill.Venables wrote: