# Coyote Graphics Routines

## Date: Fri Mar 27 12:14:20 2015

single page | use frames     summary     class     fields     routine details     file attributes

# cgrandomwald.pro

## top cgRandomWald

Utility

`result = cgRandomWald( [seed] [, dims] [, MU=double] [, LAMBDA=double])`

This function creates a vector of N random numbers using an Inverse Gaussian Distribution, which is also known as the Wald Distribution. The reference for the code can be found at http://en.wikipedia.org/wiki/Inverse_Gaussian_distribution.

### Parameters

seed in optional

The seed for the random number generator. If undefined, on output will have the seed used by the IDL RandomU function. See the documentation for RandomU for additional information.

dims in optional type=integer

A scalar or integer array defining the dimensions of the result. If no dimensions are specified, a single random number is returned. If `Dims` is a scalar, a 1D vector of that number of values will be returned.

### Keywords

MU in optional type=double default=1.0

The mean of the distribution.

LAMBDA in optional type=double default=1.0

The shape parameter of the distribution. As lambda tends to infinity, the inverse distribution becomes more like a normal distribution.

### Examples

For example, to create 100 random numbers, using the Wald distribution:

` wald = cgRandomWald(seed, 100)`
To create a 20-column by 10-row array of random numbers:
``` wald = cgRandoWald(seed, [20,10]) ```

### Author information

Author:

FANNING SOFTWARE CONSULTING:

``` David W. Fanning 1645 Sheely Drive Fort Collins, CO 80526 USA Phone: 970-221-0438 E-mail: david@idlcoyote.com Coyote's Guide to IDL Programming: http://www.idlcoyote.com ```

Copyright (c) 2012, Fanning Software Consulting, Inc.

History:

Written, 25 Oct 2012, by David W. Fanning.

## File attributes

 Modification date: Fri Mar 27 11:07:37 2015 Lines: 117 Docformat: rst rst