Ejemplo n.º 1
0
        /// <summary>
        /// Cumulative Density Function
        /// </summary>
        /// <see cref="https://en.wikipedia.org/wiki/Cumulative_distribution_function"/>
        public override double Cdf(double x)
        {
            if (x < 0)
            {
                throw new ArgumentOutOfRangeException(nameof(x), "value must not be negative");
            }
            else if (x == 0)
            {
                return(0.0);
            }

            return(0.5 + ProbabilityIntegral.Erf((Math.Log(x) - Mu) / Sigma / Math.Sqrt(2)) / 2.0);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Cumulative Density Function
 /// </summary>
 /// <see cref="https://en.wikipedia.org/wiki/Cumulative_distribution_function"/>
 public override double Cdf(double x)
 {
     return(0.5 + ProbabilityIntegral.Erf((x - Mean) / (Math.Sqrt(2) * StandardError)) / 2.0);
 }