\BIN This directory contains BAYES0.EXE and LOOPSMTH.EXE. Each of these is a version of the Bayesian function interpolation program. LOOPSMTH is specialized for batch processing using the batch files described under \LOOP below. BAYES0 is interactive, allowing exploration of different parts of the parameter space, different scalings, etc. The program's algorithm is derived assuming f(p)=a*w(p), where w is np-dimensional white noise. The kernel a is taken to be exp(-||p||~2~). This is explained further in the U. of Minnesota discussion paper on the theory underlying the program. BAYES0: The program will prompt you for the name of the input file and give you options for how to proceed. Its input file has the same structure as the LOOP.DAT input file for LOOPRATS: Line 1: A small positive real number defining the size of the change in the objective function at which convergence is assumed. Line 2: An integer NP, the number of parameters. Line 3: A vector of NP scale factors S(I), followed by a base function value B and by a normal change DN. S(I) is the size of the change in P(I), the I'th parameter, needed to substantially weaken correlation of a priori beliefs about the function values at the original and the changed point. For changes much smaller than S(I), one expects to find the function changes slowly and smoothly. B should be below the likely maximum value of the function, but probably above a substantial fraction of the observed function values on the input file. DN should be about .2 for log likelihood functions. More generally, it is a guess as to the "normal" increase in the function value to be obtained with one iteration near the start of function maximization. These "line 3" numbers can spill over onto other lines. They are read with a single free format FORTRAN read statement. Line n: After the line 3 numbers come observations, each observation beginning on a new line. An observation contains NP real numbers giving a value for the P vector followed by the actual function value F(P) at that P. Getting the scale factors approximately right can be very important for the performance of LOOP. A good way to do this is to run BAYES0 after you have used GRID and set up the LOOP.DAT input file for LOOP. Inside BAYES0 you can vary the scale factors and base values and see what happens to the corresponding likelihoods. These initial likelihoods are not values of the likelihood function you are maximizing, but the likelihood of the observed function values in LOOP.DAT, given the program's Bayesian prior for the shape of the function you are maximizing. The scale parameters should be chosen to make the likelihood of the data large. Errors of 50% or so in the scale parameters usually don't matter much. With small numbers of observations, occasionally the likelihood will increase without bound as scale factors are increased. Very large scale factors, however, produce numerical problems in the program, and in any case will eventually be seen to be unreasonable when more data is entered. Numerical problems can be detected by evaluating the function within BAYES0 at a data point. The function value calculated by the program is often not exactly the same as the input function value (which can be seen with the program's display or order commands). If the disagreement is in the 4th or higher decimal place, there is probably no problem. If it is in a lower decimal place, there is a problem, which usually can be handled by making the scale factors a little smaller. When there are accuracy problems you cannot get rid of, making C (the first element in the input file) somewhat larger than the numerical errors in the function values may help give passable results. Both BAYES0 and LOOPSMTH may produce error messages of the form "Accuracy problems at diagonal element n." If this occurs during the search for a maximum of the interpolated function, it is not an accuracy problem at all and can be ignored. If it occurs during the evaluation of the likelihood of the data at the start of the program or after a change in scales or base value, it may be a problem. For one thing, it may indicate numerical inaccuracy, which should be checked as indicated above. For another, likelihoods calculated for two different scale settings which produce different lists of n's at which accuracy problems are occurring are not comparable. There is no problem, however, if one observation is exactly the same as another. In this case the program drops the duplicate observation, and it will always do so regardless of the scale settings. \LOOP The directory LOOP contains MSDOS batch files to automatically loop through runs of the program which evaluates the function. There are two commands to do this, GRID and LOOP, in the files GRID.BAT and LOOP.BAT. These files must be adapted to your own directory names before they will work; they can easily be adapted to run programs other than arma at each iteration. If you replace "arma" with another program name "X" everywhere in both files, then this other program must read parameters from X.par, write the function value to X.val. However you can easily vary these files once you understand how they work, which you can discover from the section of the MSDOS manual on batch file processing. GRID: The purpose of GRID is to execute RATS with a fixed grid of parameter values. It is needed because if LOOP starts with only k points on its input file, its search will be confined to the k-dimensional subspace spanned by these initial k points. Thus it is always wise to run GRID for a group of n points, where n is the length of the parmeter vector, to create the initial input file for LOOP. Also, you may notice in explorations with BAYES0 that there is a section of parameter space which LOOP has not explored which looks promising. You could run GRID for a grid in that region to force LOOP to take account of it. To run GRID as it stands, you must have an executable file named arma, which reads its parameter settings from arma.par and writes a function value to arma.val. You must provide a set of parameter files arma1.par, arma2.par, etc. GRID copies each such file in succession to arma.par, evaluates the function, and accumulates the parameter settings and function values in GRID.DAT. The second batch file, GRIDARMA.BAT, is actually an integral part of GRID and must be in the directory from which GRID.BAT is run. GRIDPAR: If you are using more than two or three parameters it can be tedious to use an editor to prepare n copies of a parameter file, each varying one parameter from some central value; but such a set of files is usually what one wants to use as input to GRID. The program GRIDPAR reads a file whose name it prompts you for (say NAMEX.PAR) containing some number n of real numbers. It then writes n files, with names NAME0.PAR, NAME1.PAR, etc., with the i'th file having a value for the i'th parameter 85% of the value it has in NAMEX.PAR, while all other parameters are left as in NAMEX.PAR. These are then ready for input, possibly along with NAMEX (though usually you would already have checked NAMEX with BAYES0), to GRID. LOOP: The purpose of LOOP is to search systematically for the highest value of the likelihood. It invokes LOOPARMA.BAT, which in turn invokes the program LOOPSMTH to use Bayesian methods to guess at the shape of the likelihood based on the points calculated so far. It uses the same function evaluation program as does GRID. It requires an input file named LOOP.DAT. This file is just like the GRID.DAT file created by the GRID command, except that it has a few lines of extra information at the top. It is in the same format as is required for input to BAYES0. LOOPSMTH must also find a file named LOOP.YN which should usually contain Y or N on the first line and N on the second. If it contains Y on the first line, the parameters are logged and the scaling constants are in log units. If it contains N the scaling constants are in absolute units. For logged parameters of a likelihood scaling constants of 1 to 2 are usually OK. LOOPARMA.BAT is an integral part of LOOP.BAT and must reside in the same directory from which LOOPARMA is run. General Remarks: Running either LOOP or GRID, you can adjust the number of iterations by extending or contracting the list of iteration id numbers on the first line. \SOURCE This directory contains all the fortran source code for BAYES0 and LOOPSMTH, together with two batch files which link them. You can recompile the program to make it handle bigger problems or to work on a non-AT computer. In its current form it handles up to 120 observations on 15 parameters. It has all been compiled and linked successfully with Microsoft Fortran 5.0.