<commit_before><?php
namespace Math\Probability\Distribution;
use Math\Functions\Special;
class NormalDistribution extends Distribution {
  public static function PDF($x, $μ, $σ²) {
    $π = \M_PI;
    $pdf = exp(-1 * ($x - $μ) ** 2 / 2 / $σ²)/(sqrt(2 * $σ² * $π));
    return $pdf;
  }
  public static function CDF($x, $μ, $σ²) {
    $cdf = (1 + Special::erf(($x - $μ) / sqrt(2 * $σ²))) / 2;
    return $cdf;
  }
}<commit_msg>Moved Function Documentation<commit_after><?php
namespace Math\Probability\Distribution;
use Math\Functions\Special;
class NormalDistribution extends Distribution {
  
  /**
     * Normal distribution - probability density function
     *
     * https://en.wikipedia.org/wiki/Normal_distribution
     *
     *              1
     * f(x|μ,σ) = ----- ℯ^−⟮x − μ⟯²∕2σ²
     *            σ√⟮2π⟯
     *
     * @param number $x random variable
     * @param number $μ mean
     * @param number $σ standard deviation
     *
     * @return float f(x|μ,σ)
     */
  public static function PDF($x, $μ, $σ²) {
    $π = \M_PI;
    $pdf = exp(-1 * ($x - $μ) ** 2 / 2 / $σ²)/(sqrt(2 * $σ² * $π));
    return $pdf;
  }
  
  /**
     * Normal distribution - cumulative distribution function
     * Probability of being below X.
     * Area under the normal distribution from -∞ to X.
     *             _                  _
     *          1 |         / x - μ \  |
     * cdf(x) = - | 1 + erf|  ----- |  |
     *          2 |_        \  σ√2  / _|
     *
     * @param number $x upper bound
     * @param number $μ mean
     * @param number $σ standard deviation
     *
     * @return float cdf(x) below
     */
  public static function CDF($x, $μ, $σ²) {
    $cdf = (1 + Special::erf(($x - $μ) / sqrt(2 * $σ²))) / 2;
    return $cdf;
  }
}
{'fraction_non_alphanumeric': 0.1623785020011435, 'fraction_numerical': 0.012006861063464836, 'mean_word_length': 1.8735632183908046, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3743927', 'n_tokens_mistral': 651, 'n_tokens_neox': 626, 'n_words': 162}