ContentsINDEX

Chapter 1 Getting started with Ad Model Builder

This manual describes AD Model Builder, the fastest, most powerful software for rapid development and fitting of general nonlinear statistical models available. The accompanying demonstration disk has a number of example programs from various fields including chemical engineering, natural resource modeling, and financial modeling. As you will see, with a few statements you can build powerful programs to solve problems that would completely defeat other modeling environments. The AD Model Builder environment makes it simple to deal with recurring difficulties in nonlinear modeling, such as restricting the values which parameters can assume, carrying out the optimization in a stepwise manner, and producing a report of the estimates of the standard deviations of the parameter estimates. And these techniques scale up to models with at least 1500 independent parameters on a 120 MH Pentium PC and more on more powerful platforms. So, if you are interested in a really powerful environment for nonlinear modeling -- read on!

AD Model Builder provides a template-like approach to code generation. Instead of needing to write all the code for the model the user can employ any ASCII file editor to simply fill in the template, describing the particular aspects of the model -- data, model parameters, and the fitting criterion to be used. With this approach the specification of the model is reduced to the absolute minimum number of statements. Reasonable default behaviour for various aspects of modeling such as the input of data and initial parameters and reporting of results are provided. Of course it is possible to override this default behaviour to customize an application when desired. The command line argument -ind NAME followed by the string NAME changes the default data input file to NAME.

The various concepts embodied in AD Model Builder are introduced in a series of examples. You should at least skim through each of the examples in the order they appear so that you will be familiar with the concepts used in the later examples. The examples disk contains the AD Model Builder template code, the C++ code produced by AD Model Builder and the executable programs produced by compiling the C++ code. This process of producing the executable is automated so that the user who doesn't wish to consider the vagaries of C++ programming can go from the AD Model Builder template to the compiled executable in one step. Assuming that the C++ compiler and AD Model Builder and Autodif libraries have been properly installed, then to produce a AD Model Builder executable it is only necessary to type makeadm root where root.tpl is the name of the ASCII file containing the template specification. To simplify model development two modes of operation are provided, a safe mode with bounds checking on all array objects and an optimized mode for fastest execution.

AD Model Builder achieves its high performance levels by employing the Autodif C++ class library. Autodif combines an array language with the reverse mode of Automatic differentiation supplemented with precompiled adjoint code for the derivatives of common array and matrix operations. However, all of this is completely transparent to the AD Model Builder user. It is only necessary to provide a simple description of the statistical model desired and the entire process of fitting the model to data and reporting the results is taken care of automatically.

Although C++ potentially provides good support for mathematical modeling, the language is rather complex -- it cannot be learned in a few days. Moreover many features of the language are not needed for mathematical modeling. A novice user who wishes to build mathematical models may have a difficult time deciding which features of the language to learn and which features can be ignored until later. AD Model Builder is intended to help overcome these difficulties and to speed up model development. When using AD Model Builder most of the aspects of C++ programming are hidden from the user. In fact the beginning user can be almost unaware that C++ underlies the implementation of AD Model Builder. It is only necessary to be familiar with some of the simpler aspects of C or C++ syntax.

To interpret the results of the statistical analysis AD Model Builder provides simple methods for calculating the profile likelihood and Markov chain simulation estimates of the posterior distribution ( optional at extra cost) for parameters of interest (Hastings-Metropolis algorithm).

A short description of each example follows.