Abstract | R is a language and environment for statistical computing and graphics [1]. It currently is widely used in statistics and data mining. To obtain derivatives in R, one can use several non-native approaches, including the TMB system [2] and Ryacas [3]. However, none of these options support the differentiation of functions expressed as R programs, as would an algorithmic differentiation (AD) tool for R. Attempts to develop such a tool include radx [4]. This tool is capable of computing first-and second-order forward-mode derivatives of univariate functions. But it is no longer actively developed. Natively, inside R, the numderiv package provides methods for calculating (usually) accurate numerical first and second order derivatives [5]. Accurate calculations are done by using Richardson’s extrapolation, or, when applicable, a complex step derivative is available. A simple difference method is also provided. The deriv function from the stats package computes derivatives of simple expressions, symbolically [6]. Because numerical differences cannot be reliably accurate and cannot compute adjoints, there is a need to provide derivatives within R using AD tools. |