Example #1
0
        static void SamplesUnchecked(System.Random rnd, double[] values, double d1, double d2)
        {
            var values2 = new double[values.Length];

            ChiSquared.SamplesUnchecked(rnd, values, d1);
            ChiSquared.SamplesUnchecked(rnd, values2, d2);
            CommonParallel.For(0, values.Length, 4096, (a, b) =>
            {
                for (int i = a; i < b; i++)
                {
                    values[i] = (values[i] * d2) / (values2[i] * d1);
                }
            });
        }
Example #2
0
 /// <summary>
 /// Generates one sample from the <c>FisherSnedecor</c> distribution without parameter checking.
 /// </summary>
 /// <param name="rnd">The random number generator to use.</param>
 /// <param name="d1">The first degree of freedom (d1) of the distribution. Range: d1 > 0.</param>
 /// <param name="d2">The second degree of freedom (d2) of the distribution. Range: d2 > 0.</param>
 /// <returns>a <c>FisherSnedecor</c> distributed random number.</returns>
 static double SampleUnchecked(System.Random rnd, double d1, double d2)
 {
     return((ChiSquared.Sample(rnd, d1) * d2) / (ChiSquared.Sample(rnd, d2) * d1));
 }