Header menu logo FSharp.Stats

Random Module

Uniform random number generators

Types

Type Description

IRandom

Interface that every uniform random number generator must implement.

RandBasic

A basic implementation of a uniform random source using Random that is not thread-safe.

RandThreadSafe

A standard implementation of a uniform random source using Random that is thread-safe.

Functions and values

Function or value Description

GetSampleGenerator ()

Full Usage: GetSampleGenerator ()

Parameters:
    () : unit

Returns: IRandom The current random number generator used for sampling.

Returns the random number generator used for sampling.

() : unit
Returns: IRandom

The current random number generator used for sampling.

SetSampleGenerator rg

Full Usage: SetSampleGenerator rg

Parameters:
    rg : IRandom - The random number generator to use for sampling.

Sets the random number generator used for sampling.

rg : IRandom

The random number generator to use for sampling.

boxMullerTransform ()

Full Usage: boxMullerTransform ()

Parameters:
    () : unit

Returns: float * float A tuple of two independent, standard, normally distributed random numbers.

Generates a pair of independent, standard, normally distributed random numbers using the Box-Muller transform.

This method uses the current random number generator to generate two uniform random numbers, and then applies the Box-Muller transform to convert them into a pair of independent, standard, normally distributed random numbers.

() : unit
Returns: float * float

A tuple of two independent, standard, normally distributed random numbers.

rndgen

Full Usage: rndgen

Returns: IRandom

The uniform random source used for sampling functions.

Defaults to an instance of RandThreadSafe.

Returns: IRandom

Type something to start searching.