ContinuousDistribution.Sample Method

Definition

Namespace: Extreme.Statistics.Distributions
Assembly: Extreme.Numerics (in Extreme.Numerics.dll) Version: 8.1.23

Overload List

Sample() Returns a random sample from the distribution.
Sample(Int32) Returns a vector of random samples from the distribution.
Sample(Random) Returns a random sample from the distribution.
Sample(Int32, Random) Returns a vector of random samples from the distribution.

ContinuousDistribution.Sample

Returns a random sample from the distribution.
C#
public double Sample()

Return Value

Double
A double-precision floating-point number.

Remarks

This method uses the default random number generator specified by DefaultRandomNumberGenerator to generate a random sample from the distribution. The return values of successive calls to this method follow the distribution represented by this distribution.

ContinuousDistribution.Sample(Int32)

Returns a vector of random samples from the distribution.
C#
public Vector<double> Sample(
	int size
)

Parameters

size  Int32
The number of samples to return.

Return Value

Vector<Double>
A vector of size samples from the distribution.

Remarks

This method uses the default random number generator specified by DefaultRandomNumberGenerator to generate a random sample from the distribution. The return values of successive calls to this method follow the distribution represented by this distribution.

Exceptions

ArgumentOutOfRangeException

size is less than zero.

ContinuousDistribution.Sample(Random)

Returns a random sample from the distribution.
C#
public virtual double Sample(
	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

Double
A double-precision floating-point number.

Remarks

This method uses the random number generator specified by random to generate a random sample from the distribution. The return values of successive calls to this method follow the distribution represented by this Distribution.

Exceptions

ArgumentNullExceptionrandom is null.

ContinuousDistribution.Sample(Int32, Random)

Returns a vector of random samples from the distribution.
C#
public virtual Vector<double> Sample(
	int size,
	Random random
)

Parameters

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

Return Value

Vector<Double>
A vector of size samples from the distribution.

Remarks

This method uses the random number generator specified by random to generate a random sample from the distribution. The return values of successive calls to this method follow the distribution represented by this Distribution.

Exceptions

ArgumentNullExceptionrandom is null.
ArgumentOutOfRangeException

size is less than zero.

See Also