コード例 #1
0
 /// Assigns new values to the parameters.
 /// This method assumes that the parameters have been already checked.
 private void DefineParameters(double shape1, double shape2)
 {
     _alpha1 = shape1;
     _alpha2 = shape2;
     _norm   = GammaFunction.LogBeta(_alpha1, _alpha2);
     _gamma1 = null;
     _gamma2 = null;
     _incompleteBetaFunction = null;
 }
コード例 #2
0
        /// Assigns new degrees of freedom to the receiver.
        /// Compute the norm of the distribution after a change of parameters.
        /// @param n1 int	first degree of freedom
        /// @param n2 int	second degree of freedom
        public void DefineParameters(int n1, int n2)
        {
            _dof1 = n1;
            _dof2 = n2;
            double nn1 = 0.5 * n1;
            double nn2 = 0.5 * n2;

            _norm = nn1 * Math.Log(n1) + nn2 * Math.Log(n2)
                    - GammaFunction.LogBeta(nn1, nn2);
            _incompleteBetaFunction = null;
            _chiSquareDistribution1 = null;
            _chiSquareDistribution2 = null;
        }
コード例 #3
0
 /// @param n int	degree of freedom
 public void DefineParameters(int n)
 {
     _dof  = n;
     _norm = -(Math.Log(_dof) * 0.5
               + GammaFunction.LogBeta(_dof * 0.5, 0.5));
 }