(* source: h:\modula\defs\NormRNG.DEF     v1.0a             revised: 88.06.09
   author: G.Greene, AGCS D/429 (NS/TS), 312/681-7783       created: 88.06.09

   function:
    This is the definition for a module which exports generators of pseudo-
    random variates of the normal and related distributions.

   history:
     88.06.09  1.0a  initial release.
*)

DEFINITION MODULE  NormRNG;


(*  Return as the function value a normally-distributed LongReal value, with
    mean=0 and standard deviation=1.
*)

PROCEDURE  StdNormalVariate ( ): LONGREAL;



(*  Return as the function value a normally-distributed real value, with
   mean given by the first parameter, and standard deviation given by the
   second parameter.
*)

PROCEDURE  NormalVariate (
                  (*in*)  Mean:   REAL;
                  (*in*)  StdDev: REAL ): LONGREAL;

(*                                                                        [2]
 source: h:\modula\defs\NormRNG.DEF     v1.0a             revised: 88.06.09 *)


(*  Return as the function value a lognormally-distributed real value, with
    location and shape parameters given by the function parameters.  More
    commonly, one would want to specify the mean and standard deviation of
    of the values.  Since the computations involved in providing that form
    for the parameters would substantially slow the process of generating
    variates, a separate procedure, LognormalParameters, is provided below
    to do the conversion once for a given distribution.  The output values
    from that procedure may then be used as the parameters for this one.
*)

PROCEDURE  LognormalVariate (
                     (*in*)  Location: REAL;
                     (*in*)  Shape:    REAL ): LONGREAL;



(*  The expected value (variate mean) and standard deviation of values for a
    lognormal distribution are given as the first and second parameters,
    respectively.  Set the third and fourth parameters to the corresponding
    location and shape parameters for use with procedure LognormalVariate,
    above.
*)

PROCEDURE  LognormalParameters (
                   (*in*)       Mean:     REAL;
                   (*in*)       StdDev:   REAL;
                  (*out*)  VAR  Location: REAL;
                  (*out*)  VAR  Shape:    REAL );

                    
                    
(*  Return as the function value a Cauchy-distributed real value, with
    location (median) and scale parameters given by the function parameters.
*)

PROCEDURE  CauchyVariate (
                  (*in*)  Median: REAL;
                  (*in*)  Scale:  REAL ): LONGREAL;

END  NormRNG.
