Skip to content
Prev 4983 / 63424 Next

Suggestion for an extension of the API

Prof Brian D Ripley wrote:

            
No, my intention was to have a standard entry point from C/C++ to all of these
functions and, hence, give the package developers more flexibility. E.g., in
tseries I currently use for the garch() some fortran optimizer which directly
calls C functions for calculating the gradient and likelihood. arma from
tseries uses the optim function from R and uses the call back mechanism to
calculate the SSE. In these case, I would like to have the same solution for
both the arma and garch classes, ideally using the optimizers from R, but for
performance reasons without the indirection of back-calling R to calculate the
likelihood etc. (I know, I could use optif9, but it would be nicer if all
available optimizers could be used that way.)

For example, having something like

void
vmmin(int n0, double *b, double *Fmin, int maxit, int trace, int *mask,
      double abstol, double reltol, int nREPORT, OptStruct OS,
      int *fncount, int *grcount, int *fail,
      int (*fminfn)(int, double *, OptStruct),
      void (*fmingr)(int, double *, double *, OptStruct))

and so on

in R_ext/Applic.h (as for optif9) would probably be enough. Or as Doug (Thanks
Doug! see below) explained me, additionally introducing a pointer to a state
variable which brings information into the likelihood or gradient evaluation,
like in optif9.
...
best
Adrian

--
Dr.  Adrian Trapletti,  Olsen  &  Associates Ltd.
Seefeldstrasse 233, CH-8008  Zürich,  Switzerland
Phone: +41 (1) 386 48 47   Fax: +41 (1) 422 22 82
E-mail: adrian@olsen.ch  WWW: http://www.olsen.ch



-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._