Efficient Derivative Codes through Automatic Differentiation and Interface Contraction: An Application in Biostatistics
- 1 July 1997
- journal article
- Published by Society for Industrial & Applied Mathematics (SIAM) in SIAM Journal on Scientific Computing
- Vol. 18 (4) , 1056-1066
- https://doi.org/10.1137/s1064827595281800
Abstract
Developing code for computing the first- and higher-order derivatives of a function by hand can be very time consuming and is prone to errors. Automatic differentiation has proven capable of producing derivative codes with very little effort on the part of the user. Automatic differentiation avoids the truncation errors characteristic of divided difference approximations. However, the derivative code produced by automatic differentiation can be significantly less efficient than one produced by hand. This shortcoming may be overcome by utilizing insight into the high-level structure of a computation. This paper focuses on how to take advantage of the fact that the number of variables passed between subroutines frequently is small compared with the number of variables with respect to which one wishes to differentiate. Such an "interface contraction," coupled with the associativity of the chain rule for differentiation, allows one to apply automatic differentiation in a more judicious fashion, resulting in much more efficient code for the computation of derivatives. A case study involving the ADIFOR (Automatic Differentiation of Fortran) tool and a program for maximizing a logistic-normal likelihood function developed from a problem in nutritional epidemiology is examined, and performance figures are presented.Keywords
This publication has 8 references indexed in Scilit:
- Computing Large Sparse Jacobian Matrices Using Automatic DifferentiationSIAM Journal on Scientific Computing, 1994
- Automatic differentiation in OdysseeTellus A: Dynamic Meteorology and Oceanography, 1993
- Automatic differentiation of advanced CFD codes for multidisciplinary designComputing Systems in Engineering, 1992
- Dietary Fat and Fiber in Relation to Risk of Breast CancerJAMA, 1992
- ADIFOR–Generating Derivative Codes from Fortran ProgramsScientific Programming, 1992
- Automatic differentiation of large sparse systemsJournal of Economic Dynamics and Control, 1990
- Automatic computation of derivatives with the use of the multilevel differentiating technique—1. Algorithmic basisComputers & Mathematics with Applications, 1985
- A separator theorem for graphs of bounded genusJournal of Algorithms, 1984