ContinuousDistribution.GetRandomSequence Method

Definition

Namespace: Numerics.NET.Statistics.Distributions
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.9.0

Overload List

GetRandomSequence() Returns an infinite sequence of independent random samples drawn from this distribution.
GetRandomSequence(Random) Returns a sequence of random samples from the distribution.
GetRandomSequence(Random, Int32) Returns a sequence of random samples of the specified length from the distribution.

GetRandomSequence

Returns an infinite sequence of independent random samples drawn from this distribution.
C#
public IEnumerable<double> GetRandomSequence()

Return Value

IEnumerable<Double>
An IEnumerable<T> of Double.

Remarks

The sequence is generated lazily and uses the thread-safe random source Instance by default. Consumers should enumerate the returned IEnumerable<T> only as many samples as needed.

GetRandomSequence(Random)

Returns a sequence of random samples from the distribution.
C#
public IEnumerable<double> GetRandomSequence(
	Random random
)

Parameters

random  Random
A Random object that specifies the uniform random number generator that is to be used to generate the samples.

Return Value

IEnumerable<Double>
An IEnumerable<Double>.

Remarks

This method uses the random number generator specified by random to generate an enumerable sequence of random samples from the distribution.

Exceptions

ArgumentNullException

random is null.

GetRandomSequence(Random, Int32)

Returns a sequence of random samples of the specified length from the distribution.
C#
public IEnumerable<double> GetRandomSequence(
	Random random,
	int length
)

Parameters

random  Random
A Random object that specifies the uniform random number generator that is to be used to generate the samples.
length  Int32
The length of the sequence.

Return Value

IEnumerable<Double>
An IEnumerable<Double>.

Remarks

This method uses the random number generator specified by random to generate an enumerable sequence of random samples from the distribution.

Exceptions

ArgumentNullException

random is null.

ArgumentOutOfRangeExceptionlength is negative.

See Also