[R] Automatic differentiation in R

Finlay Scott (Cefas) finlay.scott at cefas.co.uk
Wed Jul 22 11:21:30 CEST 2009


Hi 
I recently gave a presentation about Automatic Differentiation (AD) and R at the Eighth Euro AD Workshop in Oxford (17/07/09).  The presentation was intended as a general introduction to R and the desire for a generic AD interface for R.  During the presentation I emphasised the need and the high level of interest that the R community has in developing such an interface and that input from the AD community is essential to achieve it.

The presentation seemed to generate a good level of interest and several suggestions for potential directions were made.  However, it is not clear at the moment what the best way is of implementing an AD interface in R in terms of success, difficulty and amount of work.

One suggestion was that it may be possible to develop it entirely in R, using the S4 classes and overloading the intrinsic functions.  This may not result in the fastest solution, in terms of time taken to calculate the derivatives, but could result in a 'clean' interface that was relatively straightforward to extend.

Alternatively, it may be possible to make use of a pre-exisiting AD library in another language (e.g. ADOL-C or the AutoDiff libraries from AD Model Builder).  As these libraries are C++ based this would require functions that were written in R to be parsed into C++ and then compiled before their derviatives could be found.  Although this has the advantage of using work that is already well developed, the parsing and compilation from R to C++ may make the interface 'clunky'.

It is likely that we won't know how successful either of these approaches could be until someone actually sits down and has a go at doing it.  Is there anyone out there who is interested in getting involved with this project or who has advice / time to offer?

Also, would it be possible to also post this message in the R-devel list?  I realise that this would mean 'double posting' but the potential for a generic AD interface affects many packages and may also be of interest to developers (e.g. John Nash's 'optimx' package)

Finlay Scott


***********************************************************************************
This email and any attachments are intended for the name...{{dropped:10}}




More information about the R-help mailing list