//private IncompleteBetaFunctionFraction inverseFraction; /// Constructor method. /// @param a1 double /// @param a2 double public IncompleteBetaFunction(double a1, double a2) { _alpha1 = a1; _alpha2 = a2; _logNorm = GammaFunction.LogGamma(_alpha1 + _alpha2) - GammaFunction.LogGamma(_alpha1) - GammaFunction.LogGamma(_alpha2); }
/// Assigns new values to the parameters. /// This method assumes that the parameters have been already checked. public void DefineParameters(double shape, double scale) { _alpha = shape; _beta = scale; _norm = Math.Log(_beta) * _alpha + GammaFunction.LogGamma(_alpha); if (_alpha < 1) { _b = (Math.E + _alpha) / Math.E; } else if (_alpha > 1) { _a = Math.Sqrt(2 * _alpha - 1); _b = _alpha - Math.Log(4.0); _q = _alpha + 1 / _a; _d = 1 + Math.Log(4.5); } _incompleteGammaFunction = null; }
/// Constructor method. public IncompleteGammaFunction(double a) { _alpha = a; _alphaLogGamma = GammaFunction.LogGamma(_alpha); }