Exemplo n.º 1
0
        /// <summary>
        /// The Cumulative Distribution Function (CDF) of the distribution, excluding intensity (<see cref="Distribution.N"/>).
        /// </summary>
        /// <param name="t">Time</param>
        /// <param name="NrCycles">Number of time cycles completed.</param>
        /// <returns>CDU(t)</returns>
        protected override double GetCumulativeProbability(double t, int NrCycles)
        {
            if (Math.Abs(t - this.μ) > Math.Abs(this.TimeCycleUnits + t - this.μ))
            {
                t += this.TimeCycleUnits;
                NrCycles--;
            }

            double x   = (t - this.μ) / this.σSqrt2;
            double erf = x < -5 ? -1 : x > 5 ? 1 : StatMath.Erf(x);

            return(((1 + erf) / 2) + NrCycles);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Evaluates the function on a scalar argument.
 /// </summary>
 /// <param name="Argument">Function argument.</param>
 /// <param name="Variables">Variables collection.</param>
 /// <returns>Function result.</returns>
 public override IElement EvaluateScalar(Complex Argument, Variables Variables)
 {
     return(new ComplexNumber(StatMath.Erf(Argument)));
 }
Exemplo n.º 3
0
 /// <summary>
 /// Evaluates the function on a scalar argument.
 /// </summary>
 /// <param name="Argument">Function argument.</param>
 /// <param name="Variables">Variables collection.</param>
 /// <returns>Function result.</returns>
 public override IElement EvaluateScalar(double Argument, Variables Variables)
 {
     return(new DoubleNumber(StatMath.Erf(Argument)));
 }