PHP 클래스 PhpBench\Math\Statistics

파일 보기 프로젝트 열기: dantleech/phpbench 1 사용 예제들

공개 메소드들

메소드 설명
histogram ( array $values, integer $steps = 10, float $lowerBound = null, float $upperBound = null ) : array Generate a histogram.
kdeMode ( array $population, integer $space = 512, float $bandwidth = null ) : float[] Return the mode using the kernel density estimator using the normal distribution.
linspace ( float $min, float $max, integer $num = 50, boolean $endpoint = true ) : float[] Return an array populated with $num numbers from $min to $max.
mean ( array $values ) : mixed Return the mean (average) value of the given values.
stdev ( array $values, boolean $sample = false ) : float Return the standard deviation of a given population.
variance ( array $values, boolean $sample = false ) : float Return the variance for a given population.

메소드 상세

histogram() 공개 정적인 메소드

Note this is not a great function, and should not be relied upon for serious use. For a better implementation copy: http://docs.scipy.org/doc/numpy-1.10.1/reference/generated/numpy.histogram.html
public static histogram ( array $values, integer $steps = 10, float $lowerBound = null, float $upperBound = null ) : array
$values array
$steps integer
$lowerBound float
$upperBound float
리턴 array

kdeMode() 공개 정적인 메소드

The mode is the point in the kernel density estimate with the highest frequency, i.e. the time which correlates with the highest peak. If there are two or more modes (i.e. bimodal, trimodal, etc) then we could take the average of these modes. NOTE: If the kde estimate of the population is multi-modal (it has two points with exactly the same value) then the mean mode is returned. This is potentially misleading, but When benchmarking this should be a very rare occurance.
public static kdeMode ( array $population, integer $space = 512, float $bandwidth = null ) : float[]
$population array
$space integer
$bandwidth float
리턴 float[]

linspace() 공개 정적인 메소드

Return an array populated with $num numbers from $min to $max.
public static linspace ( float $min, float $max, integer $num = 50, boolean $endpoint = true ) : float[]
$min float
$max float
$num integer
$endpoint boolean
리턴 float[]

mean() 공개 정적인 메소드

Return the mean (average) value of the given values.
public static mean ( array $values ) : mixed
$values array
리턴 mixed

stdev() 공개 정적인 메소드

Return the standard deviation of a given population.
public static stdev ( array $values, boolean $sample = false ) : float
$values array
$sample boolean
리턴 float

variance() 공개 정적인 메소드

Return the variance for a given population.
public static variance ( array $values, boolean $sample = false ) : float
$values array
$sample boolean
리턴 float