RANDOM_GAUSS macro

The RANDOM_GAUSS macro is available only in Unica Campaign.

Syntax

RANDOM_GAUSS(num [, seed]) RANDOM_GAUSS(num, mean, std [, seed])

Parameters

num

The number of random numbers to generate. This value must be a positive integer greater than zero.

mean

The mean of the Gaussian. This can be any constant value or an expression evaluating to a constant. If this parameter is not provided, the default is zero.

std

The standard deviation of the Gaussian. This can be any constant value or an expression evaluating to a constant. If this parameter is not provided, the default is one.

seed

An optional seed to use for random number generation. This must be an integer. (If a non-integer value is supplied, the floor of the value is automatically used instead.)

Description

RANDOM_GAUSS generates a column of random numbers based on a Gaussian distribution. It returns one new column containing num random numbers. If mean and std are specified, the random numbers will be generated using a Gaussian distribution with the specified mean and standard deviation. If they are not specified, the default Gaussian has a mean of zero and standard deviation of one. If seed is provided, it will be used as a seed to the random number generator.

Examples

TEMP = RANDOM_GAUSS(100)

Creates one new column named TEMP containing 100 values randomly sampled from a zero-mean, unit-standard deviation Gaussian.

TEMP = RANDOM_GAUSS(500, 3)

Creates one new column named TEMP containing 100 values randomly sampled from a zero-mean, unit-standard deviation Gaussian. The number 3 is used as a seed for the random number generator.

TEMP = RANDOM_GAUSS(5000, 100, 32)

Creates one new column named TEMP containing 5000 values randomly sampled from a Gaussian with a mean of 100 and standard deviation of 32.

TEMP = RANDOM_GAUSS(500, -1, 2, 3)

Creates one new column named TEMP containing 500 values randomly sampled from a Gaussian with a mean of -1 and a standard deviation of 2. The number 3 is used as a seed for the random number generator.

Related functions

Function Description
RANDOM Returns the specified number of random numbers