The invention provides an automated method for identifying an optimal or near optimal mathematical model to describe observed data including: a) the definition of a candidate model search space, b) methods for searching said candidate model search space to identify the optimal or near optimal model within said candidate model search space. The present invention includes algorithms for writing the computer code needed to implement and evaluate candidate models in the software package NONMEM.