[R] Automatic differentiation in R
Prof. John C Nash
nashjc at uottawa.ca
Thu Jul 23 16:27:13 CEST 2009
>> Gabor G. wrote
>> "R does not currently have AD (except for the Ryacas package
>> which can do true AD for certain simple one line functions, i..e.
>> input the function and output a function representing its
>> derivative); however, for specific problems one can get close
>> using deriv and associated functions or the approach explained
>> below using rSymPy:
>> ...
As the instigator of Finlay's participation in this work, I probably
didn't express clearly enough the contribution Gabor has made to get as
far as he has with Ryacas and rSympy, which may show another pathway for
AD/Symbolic diff. development. At UseR all conversations seemed more
rushed than I'd like.
Gabor showed Ravi Varadhan and I a way to get some derivatives via his
tools that "worked". We need to play with this a bit more to see how
general it could be -- Gabor is very fair in his post that some work is
needed for each instance. On the other hand, if analytic gradients were
straightforward, we wouldn't be exchanging posts about them.
The clear issue in my mind is that users who need gradients/Jacobians
for R want to be able to send a function X to some process that will
return another function gradX or JacX that computes analytic
derivatives. This has to be "easy", which implies a very simple command
or GUI interface. I am pretty certain the users have almost no interest
in the mechanism, as long as it works. Currently, most use numerical
derivatives, not realizing the very large time penalty and quite large
loss in accuracy that can compromise some optimization and differential
equation codes. I'll try to prepare a few examples to illustrate this
and post them somewhere in the next few weeks. Time, as always, ...
However, the topic does appear to be on the table.
JN
More information about the R-help
mailing list