General Modeling Library Overview

 


Figure 1

Figure 1 shows a schematic diagram of the software architecture for the General Modeling Library (GML). Dependency of a software component is indicated by "gravity." If a box rests directly on top of another box, then the software component represented by that top box uses part of (makes direct calls to) the software component in the bottom box. The figure shows that the (GML) makes use of several Numerical Recipes in C (NRC) routines, but is otherwise independent of other software.
 
Note: You are not prevented in any way from using other functions and code from the Macintosh Video Library, Image Manipulation Library, the MacOS, or elsewhere.

Convention: C++ class names in my libraries are (with a few exceptions) prefixed with a three letter acronym taken from the name of the library. Hence the name of the interface-defining class in this library: gml_generic_fitter.
 

When using the gml_generic_fitter object to fit models to data you will generally perform the following actions.
  • derive a new class (say, my_fitter) from the gml_generic_fitter class, declaring and writing the required interface functions together with whatever constructors/destructors are necessary
  • allocate a my_fitter object, configuring the fitter by guessing starting values for all the parameters and setting the convergence criteria
  • load your data in the appropriate storage
  • call the fitting routine
  • check to make sure the fitter converged
  • call the fit-statistic and covariance-information calculation routines
  • (optionally) do a rigorous confidence interval calculation
  • The gml_generic_fitter Object

    This sequence of actions described above is done with a set of gml_generic_fitter class methods detailed in the header file, consisting primarily of
  • set_convergence() -- when to terminate search
  • configure_parameter() -- max, min, initial guess
  • fit_data() -- use Powell's method to find the minimum
  • parameter_value() -- grab the (optimal) model parameter value
  • calculate_covariance_information() -- lots of info (see class definition)
  • calculate_fit_statistics() -- lots of info (see class definition)
  • find_parameter_CI() -- find confidence intervals using error surface search
  • Example Code

    I include here two classes, my_data and my_fitter, that provide an example of how to use this library. The

    example header file

    contains the definitions and code for my_data and my_fitter. Then the

    example main program

    uses them to fit a Weibull function to simulated psychophysical data.