www.delorie.com/gnu/docs/mcsim/mcsim_32.html   search  
Buy GNU books!

MCSim User' Manual

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.3.4 MonteCarlo() specification

Monte Carlo simulations (Hammersley and Handscomb, 1964; Manteufel, 1996) (see section Bibliographic References) require the use of two specifications, MonteCarlo() and Distrib(), which must appear in the global section of the file, before the Experiment sections. Such Monte Carlo specifications are ignored if they appear in an Experiment specification.

The MonteCarlo specification gives general information required for the runs: the output file name, the number of runs to perform, and a starting seed for the random number generator. Its syntax is:

MonteCarlo("<OutputFilename>", <nRuns>, <RandomSeed>);

The output filename is a string field and must be enclosed in quotes. If a null-string "" is given, the default name `simmc.out' will be used. The seed of the pseudo-random number generator can be any positive real number. Seeds between 1.0 and 2147483646.0 are used as is, others are rescaled within those bounds (and a warning is issued). Here is an example of use:

MonteCarlo("percsimmc.out", 5, 9386.630);

The parameters' sampling distributions are specified by a list of Distrib specifications, as explained in the next section. The format of the output file of Monte Carlo simulations is discussed later (see section 6.6 Analyzing results).

  webmaster     delorie software   privacy  
  Copyright 2003   by The Free Software Foundation     Updated Jun 2003