コード例 #1
0
        /// <summary>
        /// This function return the value of this ChiSquareFunction for given x
        /// </summary>
        /// <param name="x">double. x</param>
        /// <returns>
        /// the value of this ChiSquareFunction for given x
        /// </returns>
        public override double  Value(double x)
        {
            double        result;
            GammaFunction function = new GammaFunction();

            result  = 1.0 / (Math.Pow(2.0, 0.5 * this.k) * function.Value(0.5 * this.k));
            result *= Math.Exp(-0.5 * x);
            result *= Math.Pow(x, 0.5 * this.k - 1.0);
            return(result);
        }
コード例 #2
0
 /// <summary>
 /// This function return the value of FisherFunction for given x
 /// </summary>
 /// <param name="x">double. x</param>
 /// <returns>
 /// The value of FisherFunction for given x
 /// </returns>
 public override double Value(double x)
 {
     double GpG, result;
     int k1plusk2 = this.k1 + this.k2;
     GammaFunction function = new GammaFunction();
     GpG = function.Value(0.5 * k1plusk2) /
         (function.Value(0.5 * this.k1) * function.Value(0.5 * this.k2));
     result = GpG * Math.Pow(this.k1, 0.5 * this.k1) * Math.Pow(this.k2, 0.5 * this.k2);
     result *= Math.Pow(x, 0.5 * this.k1 - 1.0) * Math.Pow(this.k2 + this.k1 * x, -0.5 * k1plusk2);
     return result;
 }
コード例 #3
0
        /// <summary>
        /// This function return the value of FisherFunction for given x
        /// </summary>
        /// <param name="x">double. x</param>
        /// <returns>
        /// The value of FisherFunction for given x
        /// </returns>
        public override double Value(double x)
        {
            double        GpG, result;
            int           k1plusk2 = this.k1 + this.k2;
            GammaFunction function = new GammaFunction();

            GpG = function.Value(0.5 * k1plusk2) /
                  (function.Value(0.5 * this.k1) * function.Value(0.5 * this.k2));
            result  = GpG * Math.Pow(this.k1, 0.5 * this.k1) * Math.Pow(this.k2, 0.5 * this.k2);
            result *= Math.Pow(x, 0.5 * this.k1 - 1.0) * Math.Pow(this.k2 + this.k1 * x, -0.5 * k1plusk2);
            return(result);
        }