Exemple #1
0
        /// <summary>
        /// This function return the probability density function (PDF)
        /// for Fisher Distribution for given x and number degree of
        /// freedoms are k1 and k2.
        /// </summary>
        /// <param name="x">double. x</param>
        /// <param name="k1">int. k1 is firt number degree of freedom</param>
        /// <param name="k2">int. k2 is second number degree of freedom</param>
        /// <returns>
        /// The value of probability density function (PDF)
        /// for Fisher Distribution for given x and number degree of
        /// freedoms are k1 and k2.
        /// </returns>
        private static double PDF(double x, int k1, int k2)
        {
            // number degree of freedoms and x must greater than 0
            if (!(k1 > 0 && k2 > 0 && x > 0))
            {
                return(double.NaN);
            }
            FisherFunction function = new FisherFunction(k1, k2);

            return(function.Value(x));
        }
Exemple #2
0
        /// <summary>
        /// This function return the cummulative distribution function (CDF)
        /// for Fisher Distribution with X from 0 to x and number degree of freedoms
        /// are k1 and k2.
        /// </summary>
        /// <param name="x">double. x</param>
        /// <param name="k1">int. k1 is firt number degree of freedom</param>
        /// <param name="k2">int. k2 is second number degree of freedom</param>
        /// <returns>
        /// The value of cummulative distribution function (CDF)
        /// for Fisher Distribution with X from 0 to x and number degree of freedoms
        /// are k1 and k2.
        /// </returns>
        public static double CDF(double x, int k1, int k2)
        {
            // number degree of freedoms and x must greater than 0
            if (!(k1 > 0 && k2 > 0 && x > 0))
            {
                return(double.NaN);
            }
            FisherFunction function = new FisherFunction(k1, k2);

            return(Integrator.GaussLegendre(function, 0, x, 1.0e-6));
        }