PHP Class MathPHP\Probability\Distribution\Continuous\Uniform

Inheritance: extends Continuous
Show file Open project: markrogoyski/math-php

Public Methods

Method Description
CDF ( number $a, number $b, number $x ) Continuous uniform distribution - cumulative distribution function https://en.wikipedia.org/wiki/Uniform_distribution_(continuous)
PDF ( number $a, number $b, number $x ) Continuous uniform distribution - probability desnsity function https://en.wikipedia.org/wiki/Uniform_distribution_(continuous)
mean ( number $a, number $b ) : number Mean of the distribution

Method Details

CDF() public static method

cdf = 0 for x < a x - a cdf = ----- for a ≤ x < b b - a cdf = 1 x ≥ b
public static CDF ( number $a, number $b, number $x )
$a number lower boundary of the distribution
$b number upper boundary of the distribution
$x number percentile

PDF() public static method

1 pdf = ----- for a ≤ x ≤ b b - a pdf = 0 for x < a, x > b
public static PDF ( number $a, number $b, number $x )
$a number lower boundary of the distribution
$b number upper boundary of the distribution
$x number percentile

mean() public static method

a + b μ = ----- 2
public static mean ( number $a, number $b ) : number
$a number lower boundary of the distribution
$b number upper boundary of the distribution
return number