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

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

https://en.wikipedia.org/wiki/Beta_function Γ(x)Γ(y) B(x, y) = -------- Γ(x + y)
public static beta ( integer $x, integer $y ) : float
$x integer
$y integer
Результат float
    public static function beta($x, $y) : float
    {
        if ($x == 0 || $y == 0) {
            return \INF;
        }
        $Γ⟮x⟯Γ⟮y⟯ = self::gamma($x) * self::gamma($y);
        $Γ⟮x + y⟯ = self::gamma($x + $y);
        return $Γ⟮x⟯Γ⟮y⟯ / $Γ⟮x + y⟯;
    }

Usage Example

Пример #1
0
 /**
  * Probability density function
  *
  *       xᵃ⁻¹(1 - x)ᵝ⁻¹
  * pdf = --------------
  *           B(α,β)
  *
  * @param number $α shape parameter α > 0
  * @param number $β shape parameter β > 0
  * @param number $x x ∈ (0,1)
  *
  * @return float
  */
 public static function PDF($x, $α, $β)
 {
     Support::checkLimits(self::LIMITS, ['x' => $x, 'α' => $α, 'β' => $β]);
     $xᵃ⁻¹ = pow($x, $α - 1);
     $⟮1 − x⟯ᵝ⁻¹ = pow(1 - $x, $β - 1);
     $B⟮α、β⟯ = Special::beta($α, $β);
     return $xᵃ⁻¹ * $⟮1 − x⟯ᵝ⁻¹ / $B⟮α、β⟯;
 }
All Usage Examples Of MathPHP\Functions\Special::beta