/// <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); }
/// <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)); }
/// <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)); }
/// <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); }
/// <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)); }
/// <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)); }
/// <summary> /// Fills an array with samples generated from the distribution. /// </summary> public void Samples(double[] values) { Gamma.SamplesUnchecked(_random, values, _shape, _rate); }
/// <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)); }