Continuous Distribution.Sample Method
Definition
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.0
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
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
Argument | 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
Argument | 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
Argument | random is null. |
Argument | size is less than zero. |