[ut.na] NAgMAg v89 #23

krj@na.toronto.edu (Ken Jackson) (11/15/89)

From:	nagmag%ukc.ac.uk@NSFNET-RELAY.AC.UK
Date:	Wed, 15 Nov 89 07:13:53 EST
Subject: NAgMAg v89 #23

NAgMAg		Wednesday,  November 15 1989	Volume 89   Issue 23

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%   The official electronic digest of the NAG Users Association   %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Today's Topics
                Random Numbers and the 'Marsaglia Effect'
                                 G05CBF
   			  New library routines
                            Replies from NAG

---------------------------

Date: Sun, 22 Oct 89 17:54:35 BST
From: NMM1@phoenix.cambridge.ac.uk
Subject: Random Numbers and the 'Marsaglia Effect'

Jonathan Wheeler asked whether G05CAF suffers from the 'Marsaglia Effect'
(i.e. that numbers fall on planes in a multi-dimensional lattice.  The
answer is "yes, but not seriously".

All multiplicative congruential generators suffer from this effect, as well
as some other kinds of generator.  It is typically serious only when one of
the following conditions is true:

    1) The generator is frightful (e.g. the late (I hope) unlamented RANDU
in SSP).

    2) The random number has modulus P**Q and is broken apart into its
constituent 'digits' (i.e. 0 to P-1 values).

    3) The multi-dimensional simulation is very sensitive to such effects,
AND uses a large number of random variates.

G05CAF uses a modulus of 2**59 (much more than most comparable generators)
and has been validated by Marsaglia's Spectral Test at least up to
dimension 8.  If a simulation uses less than 10**9 numbers, it would be
very unlucky to have serious problems with this effect, and even larger
ones will normally be all right.  All 32-bit generators (prime modulus or
not) are almost certain to be worse, which is why I do not recommend them.

Nick Maclaren
University of Cambridge Computer Laboratory
nmm1 @ uk.ac.cam.phx

---------------------------

Date: 06 Nov 89  13:16:14 gmt
From: P.Visscher@ed.ac.uk
Subject: G05CBF

Dear Sir, Madam,

I have the following unexplained problem with one of the
NAG routines:

My (Fortran77) simulation program consists of an outer
loop (replicates) and an inner loop (samples). To 
initialise the Random number generator (G05DDF, which
calls the uniform subr.) I call G05CBF, with a random
integer seed as parameter.

The problem occurs whenever I call G05CBF WITHIN the outer
loop, that is for every replicate. Whenever i do this the
variance generated is less than it should be. Not only the
overall variance (over replicates) is reduced, but
also the mean variance for each sample. At first i
thought that the seeds were somehow correlated, but
this does not seem to be the case.

Can anybody tell me what is going on? I do realise i 
don't have to call the initialisation routine for
each replicate, but i do have programs where such
a strategy is required.

For each replicate I read and write a random seed
from a file. This random seed is generated within
the program using a uniform distribution (not
necessarily a NAG routine).

Peter Visscher

---------------------------

Date: Wed, 15 Nov 89  11:36 GMT
From: trh@uk.ac.ukc
Subject: New library routines


Anybody out there desperate to see any new facilities in the
main Fortran library. For example, would Toeplitz linear
equation solvers be of use? Anyone else have their own favourite
missing facility?

Come now don't be shy - lets have your suggestions!

Tim

---------------------------

Date:           Mon, 13 Nov 89  14:54 GMT
From:           Caroline J Foers <CAROLINE@vax.nag.co.uk>
Subject:        Replies from NAG

Reply to issue 22
-----------------

re: Random Number Generation
    ------------------------

The results of the spectral test on the NAG random number generator are
given on page 2 of the routine document for G05CAF.  These results show
that G05CAF is only likely to display such effects at a higher number
of dimensions than the six dimensions of RNDM.

Geoff Morgan

---------------------------

%%   For NAGUA membership details contact:
%% Janet Bentley, Administrator NAGUA,
%% Shore Lane Farm, Blackstone Edge Old Road,
%% LITTLEBOROUGH, Lancashire, OL15 0LQ, UK.
%%
%% For other NAGUA enquiries contact:
%% Caroline J Foers
%% NAGUA Coordinator,
%% NAG Users Association,
%% PO Box 426,
%% Oxford, OX2 8SD, U.K.
%%
%% e-mail   caroline@uk.co.nag.vax

%%
%%   Replies or submissions to          nagmag@uk.ac.ukc
%%   Distribution changes to    nagmag-request@uk.ac.ukc
%%
%%   END OF ISSUE 


---------------------

Reposted by

Prof. Kenneth R. Jackson,      krj@na.toronto.edu   (on Internet, CSNet, 
Computer Science Dept.,                              ARPAnet, BITNET)
University of Toronto,         krj@na.utoronto.ca   (on CDNnet and other 
Toronto, Ontario,                                    X.400 nets (Europe))
Canada   M5S 1A4               ...!{uunet,pyramid,watmath,ubc-cs}!utai!krj
(Phone: 416-978-7075)                               (on UUCP)
(FAX: 416-978-4765)