Continuous Distribution.Sample Method
Definition
Assembly: Extreme.Numerics (in Extreme.Numerics.dll) Version: 8.1.23
Overload List
Sample() | Returns a random sample from the distribution. |
Sample( | Returns a vector of random samples from the distribution. |
Sample( | Returns a random sample from the distribution. |
Sample( | Returns a vector of random samples from the distribution. |
Sample
public double Sample()
Return Value
DoubleA 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.
Sample(Int32)
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. |
Sample(Random)
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
DoubleA 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
ArgumentNullException | random is null. |
Sample(Int32, Random)
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
ArgumentNullException | random is null. |
ArgumentOutOfRangeException | size is less than zero. |