MathPHP\Functions\Special::erf PHP Метод

erf() публичный статический Метод

Error function (Gauss error function) Convenience method for errorFunction
public static erf ( number $x ) : number
$x number
Результат number
    public static function erf($x)
    {
        return self::errorFunction($x);
    }

Usage Example

Пример #1
0
 /**
  * Log normal distribution - cumulative distribution function
  *
  * https://en.wikipedia.org/wiki/Log-normal_distribution
  *
  *       1   1      / ln x - μ \
  * cdf = - + - erf |  --------  |
  *       2   2      \   √2σ     /
  *
  * @param  number $x > 0
  * @param  number $μ location parameter
  * @param  number $σ scale parameter > 0
  * @return number
  */
 public static function CDF($x, $μ, $σ)
 {
     Support::checkLimits(self::LIMITS, ['x' => $x, 'μ' => $μ, 'σ' => $σ]);
     $π = \M_PI;
     $⟮ln x − μ⟯ = log($x) - $μ;
     $√2σ = sqrt(2) * $σ;
     return 1 / 2 + 1 / 2 * Special::erf($⟮ln x − μ⟯ / $√2σ);
 }
All Usage Examples Of MathPHP\Functions\Special::erf