Simulation of the Timing Experiment

To simulate the behavior of an animal in a particular procedure, both the procedure and the timing model must be specified in a computer program. For some purposes, spreadsheets can be used (Collyer, 1992), but for procedures involving many stimuli, responses, and response contingencies, they may become difficult to write in an orderly manner and may execute slowly. Many different languages, such as C and Pascal, can be used for simulations. MATLAB (MathWorks, Natick, MA) is a particularly good software system to use for simulation of behavior and for comparison of data from theory and model. There are a large number of built-in functions, and other packages of functions are available in toolboxes or can be readily written by the user. With these functions it is easy to write well-organized programs that are easy to read, execute rapidly, and may be accompanied by standard or customized graphs.

The structure of the Matlab program used for the simulation of scalar timing theory has a simple, modular organization and should be clear. This simulation was done with the description of scalar timing theory separate from the description of the fixed-interval procedure. The Matlab code that was used to simulate the procedure and the formal model is in Appendix 1. Comments about this code follow. For large projects in which the speed of operation is critical, a faster speed can easily be achieved with improvements in hardware (such as a faster processor or an increase in random-access memory) or software (such as manipulations of vectors and matrices instead of the use of "for loops," and the compilation of the source code).

0 0

Post a comment