Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

Differences Between: [Versions 400 and 401] [Versions 401 and 402] [Versions 401 and 403]

(no description)

File Size: 280 lines (10 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

Beta:: (8 methods):
  distribution()
  inverse()
  calculateInverse()
  incompleteBeta()
  logBeta()
  betaFraction()
  betaValue()
  regularizedIncompleteBeta()


Class: Beta  - X-Ref

distribution($value, $alpha, $beta, $rMin = 0.0, $rMax = 1.0)   X-Ref
BETADIST.

Returns the beta distribution.

param: mixed $value Float value at which you want to evaluate the distribution
param: mixed $alpha Parameter to the distribution as a float
param: mixed $beta Parameter to the distribution as a float
param: mixed $rMin as an float
param: mixed $rMax as an float
return: array|float|string

inverse($probability, $alpha, $beta, $rMin = 0.0, $rMax = 1.0)   X-Ref
BETAINV.

Returns the inverse of the Beta distribution.

param: mixed $probability Float probability at which you want to evaluate the distribution
param: mixed $alpha Parameter to the distribution as a float
param: mixed $beta Parameter to the distribution as a float
param: mixed $rMin Minimum value as a float
param: mixed $rMax Maximum value as a float
return: array|float|string

calculateInverse(float $probability, float $alpha, float $beta, float $rMin, float $rMax)   X-Ref

return: float|string

incompleteBeta(float $x, float $p, float $q)   X-Ref
Incomplete beta function.

param: float $x require 0<=x<=1
param: float $p require p>0
param: float $q require q>0
author: Jaco van Kooten
author: Paul Meagher
return: float 0 if x<0, p<=0, q<=0 or p+q>2.55E305 and 1 if x>1 to avoid errors and over/underflow

logBeta(float $p, float $q)   X-Ref
The natural logarithm of the beta function.

param: float $p require p>0
param: float $q require q>0
author: Jaco van Kooten
return: float 0 if p<=0, q<=0 or p+q>2.55E305 to avoid errors and over/underflow

betaFraction(float $x, float $p, float $q)   X-Ref
Evaluates of continued fraction part of incomplete beta function.
Based on an idea from Numerical Recipes (W.H. Press et al, 1992).

author: Jaco van Kooten

betaValue(float $a, float $b)   X-Ref
No description

regularizedIncompleteBeta(float $value, float $a, float $b)   X-Ref
No description