Up one level
#
Behavioural Sequences package

## Second new version in September 2005: now works with Mathematica 5 in two ways!

You can download here a Mathematica package that will implement the model
of Grafen (2002). (Full citation: Grafen, A. 2002. ‘A state-free optimization
model for sequences of behaviour’. Animal Behaviour 63, 183-191.).
You need Mathematica to run this package. Mathematica is published by
Wolfram Research Inc. For information on Mathematica, you can e-mail to
info@wri.com. The package was written and used with version 4.0 of Mathematica.
A downward incompatibility in FindMinimum has necessitated alterations, and there seem to be problems with the current version of FindMinimum -- suggested by the fact that Wolfram offers a "workaround" for persuading it to do its job in some circumstances. There are two ways to use the package with version 5.

Method A. I have rewritten the package in line with Wolfram's workaround on the changes to
FindMinimum. Thus you can download the new package and use that. BUT there sometimes seems to be a
large performance penalty to pay here.

Method B is to continue to use the version 4 package, but to be careful how you specify certain parameters. A different documenting notebook is supplied to explain how this is done for the example
of generating the data for the figures in the source paper. This is less general, and could fail to work, but
the calculation of the source paper's Fig 5b data takes about one hour with Method A, and less than 4 minutes with Method B.

There are three files for the Version 4 package. The package itself is in
init.m,
and the documenting notebook is in howtousebehseq.nb for
Mathematica 4, and in howtousebehseq11.nb for
Mathematica 5.

There are two files for the Version 5 package. The package itself is in init.m,
and the documenting notebook is in howtousebehseqvA.nb.

To use, create a folder called "behseq" (case is important), and place
the init.m file in it. Then put the folder in the Extra Packages folder in the
Add-Ons folder in the Mathematica folder -- it must be there for Mathematica
to find the package when it is called for. To find these folders, it may be necessary to
right-click or alt-click on the Mathematica icon to produce a drop-down menu, and choose
"Show Package Contents".
Open the relevant "howtouse" notebook for your package and version
for fully worked "live" examples, including generating all the data for
the figures in the original paper.

Alan Grafen 7th September 2005

Up one level