NSoft.NFramework.Numerics.Distributions.Continuous.Normal.DensityLn C# (CSharp) Method

DensityLn() public method

분포의 로그 확률 밀도
public DensityLn ( double x ) : double
x double
return double
        public double DensityLn(double x) {
            return DensityLn(_mean, _stDev, x);
        }

Same methods

Normal::DensityLn ( double mean, double stDev, double x ) : double

Usage Example

Beispiel #1
0
        /// <summary>
        /// 분포의 로그 확률 밀도
        /// </summary>
        /// <param name="x"></param>
        /// <returns></returns>
        public double DensityLn(double x)
        {
            // TODO JVG we can probably do a better job for Cauchy special case
            if (double.IsPositiveInfinity(_dof))
            {
                return(Normal.DensityLn(_location, _scale, x));
            }

            var d = (x - _location) / _scale;

            return(SpecialFunctions.GammaLn((_dof + 1.0) / 2.0)
                   - (0.5 * ((_dof + 1.0) * Math.Log(1.0 + (d * d / _dof))))
                   - SpecialFunctions.GammaLn(_dof / 2.0)
                   - (0.5 * Math.Log(_dof * Math.PI)) - Math.Log(_scale));
        }