예제 #1
0
 /// <summary>
 /// Fills an array with samples generated from the distribution.
 /// </summary>
 /// <param name="values">The array to fill with the samples.</param>
 /// <param name="shape">The shape (k) of the Erlang distribution. Range: k ≥ 0.</param>
 /// <param name="rate">The rate or inverse scale (λ) of the Erlang distribution. Range: λ ≥ 0.</param>
 /// <returns>a sequence of samples from the distribution.</returns>
 public static void Samples(double[] values, int shape, double rate)
 {
     Gamma.Samples(values, shape, rate);
 }
예제 #2
0
 /// <summary>
 /// Generates a sample from the distribution.
 /// </summary>
 /// <param name="shape">The shape (k) of the Erlang distribution. Range: k ≥ 0.</param>
 /// <param name="rate">The rate or inverse scale (λ) of the Erlang distribution. Range: λ ≥ 0.</param>
 /// <returns>a sample from the distribution.</returns>
 public static double Sample(int shape, double rate)
 {
     return(Gamma.Sample(shape, rate));
 }
예제 #3
0
 /// <summary>
 /// Generates a sequence of samples from the distribution.
 /// </summary>
 /// <param name="shape">The shape (k) of the Erlang distribution. Range: k ≥ 0.</param>
 /// <param name="rate">The rate or inverse scale (λ) of the Erlang distribution. Range: λ ≥ 0.</param>
 /// <returns>a sequence of samples from the distribution.</returns>
 public static IEnumerable <double> Samples(int shape, double rate)
 {
     return(Gamma.Samples(shape, rate));
 }
예제 #4
0
 /// <summary>
 /// Fills an array with samples generated from the distribution.
 /// </summary>
 /// <param name="rnd">The random number generator to use.</param>
 /// <param name="values">The array to fill with the samples.</param>
 /// <param name="shape">The shape (k) of the Erlang distribution. Range: k ≥ 0.</param>
 /// <param name="rate">The rate or inverse scale (λ) of the Erlang distribution. Range: λ ≥ 0.</param>
 /// <returns>a sequence of samples from the distribution.</returns>
 public static void Samples(System.Random rnd, double[] values, int shape, double rate)
 {
     Gamma.Samples(rnd, values, shape, rate);
 }
예제 #5
0
 /// <summary>
 /// Generates a sequence of samples from the distribution.
 /// </summary>
 /// <param name="rnd">The random number generator to use.</param>
 /// <param name="shape">The shape (k) of the Erlang distribution. Range: k ≥ 0.</param>
 /// <param name="rate">The rate or inverse scale (λ) of the Erlang distribution. Range: λ ≥ 0.</param>
 /// <returns>a sequence of samples from the distribution.</returns>
 public static IEnumerable <double> Samples(System.Random rnd, int shape, double rate)
 {
     return(Gamma.Samples(rnd, shape, rate));
 }
예제 #6
0
 /// <summary>
 /// Generates a sample from the distribution.
 /// </summary>
 /// <param name="rnd">The random number generator to use.</param>
 /// <param name="shape">The shape (k) of the Erlang distribution. Range: k ≥ 0.</param>
 /// <param name="rate">The rate or inverse scale (λ) of the Erlang distribution. Range: λ ≥ 0.</param>
 /// <returns>a sample from the distribution.</returns>
 public static double Sample(System.Random rnd, int shape, double rate)
 {
     return(Gamma.Sample(rnd, shape, rate));
 }
예제 #7
0
 /// <summary>
 /// Fills an array with samples generated from the distribution.
 /// </summary>
 public void Samples(double[] values)
 {
     Gamma.SamplesUnchecked(_random, values, _shape, _rate);
 }
예제 #8
0
 /// <summary>
 /// Generates a sample from the Erlang distribution.
 /// </summary>
 /// <returns>a sample from the distribution.</returns>
 public double Sample()
 {
     return(Gamma.SampleUnchecked(_random, _shape, _rate));
 }