# MaxSA

## Overview

The`MaxSA`package provides an implementation in Ox of the

*Simulated Annealing*algorithm for optimizing non-smooth functions with possible multiple local maxima.

The implementation follows exactly the implementation of Goffe, William L., Gary D. Ferrier, and John Rogers, who provide programs in Fortran and Gauss. Note that an earlier translation of the code to Ox was made by Michael Creel.

The following abstract and description are copied straight from the original Fortran code, adapting only Goffe's e-mail address:

### Abstract

Simulated annealing is a global optimization method that distinguishes between different local optima. Starting from an initial point, the algorithm takes a step and the function is evaluated. When minimizing a function, any downhill step is accepted and the process repeats from this new point. An uphill step may be accepted. Thus, it can escape from local optima. This uphill decision is made by the Metropolis criteria. As the optimization process proceeds, the length of the steps decline and the algorithm closes in on the global optimum. Since the algorithm makes very few assumptions regarding the function to be optimized, it is quite robust with respect to non-quadratic surfaces. The degree of robustness can be adjusted by the user. In fact, simulated annealing can be used as a local optimizer for difficult functions.This implementation of simulated annealing was used in "Global Optimization of Statistical Functions with Simulated Annealing," Goffe, Ferrier and Rogers, Journal of Econometrics, vol. 60, no. 1/2, Jan./Feb. 1994, pp. 65-100. Briefly, we found it competitive, if not superior, to multiple restarts of conventional optimization routines for difficult optimization problems.

For more information on this routine, contact its author: Bill Goffe, goffe@oswego.edu

For information on the Ox-version of the software, you can contact c.s.bos@vu.nl.

### References

Goffe, William L., Gary D. Ferrier, and John Rogers (1994). Global Optimization of Statistical Functions with Simulated Annealing.*Journal of Econometrics*, 60(1/2):65-99.

Fortran code available as http://emlab.berkeley.edu/Software/abstracts/goffe895.html

# Installation instructions

To install the package,- download maxsa.zip and unzip this file from
your Ox folder (using folder names). This creates files in the
directory
`<ox-home>/packages/maxsa`. In this case, no change of the`OX7PATH`environment variable is needed.

Installation in a local directory is also possible; e.g. if you install under Windows in`c:\myox`, resulting in files inc:\myox\packages\maxsa

then make sure that the directory`c:\myox`is included in the`OX7PATH`variable. **Option A:**

Put the file <ox-home>/packages/maxsa/doc/maxsa.html in your list of bookmarks, or, better even,

**Option B:**

Edit`<ox-home>/doc/oxmenu.html`, adding a line<tr><td><a href="../packages/maxsa/doc/maxsa.html">MaxSA reference</a></td></tr>

before the line referring to the`Predefined constants`such that the documentation is available from the standard Ox documentation.

## Change log, loose ends

- 20/6/2013
- Updated manual for Ox7
- 30/3/2010 (new version of maxsa.zip)
- Thanks to Pawel Janus, got rid of an error when using constrained optimization. In the original version the bounds were not fully taken into account.
- 31/1/2008
- Changed manner of inclusion. From now on, the package should be
imported using
#import instead of included as before. - 25/6/2007
- Adapted installation instructions to refer to
`OX4PATH`. - 5/12/2006
- Added option to indicate lower and upper bounds on the parameters in the call to MaxSA.
- 19/12/2002
- Implemented an extra warning for low initial temperature, improved the documentation on this point, and changed output to indicate that indeed we are maximizing instead of minimizing. Thanks to M.Creel for pointing this all out to me.
- 2/10/2002
- Publication of package on web