Kyeongmi Cheon
2008-Mar-07 05:05 UTC
[R] parameters for lbfgsb (function for optimization)
Can anyone help me with lbfgsb (function for optimization)? It takes the following parameters: void lbfgsb (int n, int lmm, double *x, double *lower, double *upper, int *nbd, double *Fmin, optimfn fn, optimgr gr, int *fail, void *ex, double factr, double pgtol, int *fncount, int *grcount, int maxit, char *msg, int trace, int nREPORT); What do I put for parameter ex (11th parameter)? I looked at optim.c codes at R sites and it's a structure that has bunch of objects such as SEXP R_fcall, SEXP R_gcall, SEXP R_env, double* ndeps, etc. I cannot figure out what it is about. How about fncount, rcount? R-ext.pdf or R help does not explain it in detail. Any comments would help. Thank you. [[alternative HTML version deleted]]
Bill.Venables at csiro.au
2008-Mar-07 08:28 UTC
[R] parameters for lbfgsb (function for optimization)
Whoa! If you want to optimise in R, you need to write an R function to define your objective. If that function is already written in C, as appears to be the case, you need to write an interfact to make it available to R. This is not exactly something novices would take on lightly. If you wish to optimise directly in C, then you should look for software support to do it that was intended for the purpose. The R source code is not like that. You can use it if you want, but you must expect it to be difficult and very puzzling, since it is not intended to be free-standing, but part of a large, complex system. Best of luck. Bill Venables CSIRO Laboratories PO Box 120, Cleveland, 4163 AUSTRALIA Office Phone (email preferred): +61 7 3826 7251 Fax (if absolutely necessary): +61 7 3826 7304 Mobile: +61 4 8819 4402 Home Phone: +61 7 3286 7700 mailto:Bill.Venables at csiro.au http://www.cmis.csiro.au/bill.venables/ -----Original Message----- From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On Behalf Of Kyeongmi Cheon Sent: Friday, 7 March 2008 3:06 PM To: r-help at r-project.org Subject: [R] parameters for lbfgsb (function for optimization) Can anyone help me with lbfgsb (function for optimization)? It takes the following parameters: void lbfgsb (int n, int lmm, double *x, double *lower, double *upper, int *nbd, double *Fmin, optimfn fn, optimgr gr, int *fail, void *ex, double factr, double pgtol, int *fncount, int *grcount, int maxit, char *msg, int trace, int nREPORT); What do I put for parameter ex (11th parameter)? I looked at optim.c codes at R sites and it's a structure that has bunch of objects such as SEXP R_fcall, SEXP R_gcall, SEXP R_env, double* ndeps, etc. I cannot figure out what it is about. How about fncount, rcount? R-ext.pdf or R help does not explain it in detail. Any comments would help. Thank you. [[alternative HTML version deleted]] ______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.