pStats
, (*1)
A PHP library containing a lot of statistical methods, from the most usefull ones (like mean and variance) to even some more sophisticated,
like moving average and outliers around median., (*2)
I intend to keep updating this library in order for it to be as thorough as possible., (*3)
Install with composer composer require magaras/pstats
., (*4)
The library supports the following methods:
Mean, (*5)
Basic::mean($data);
** Median**, (*6)
Basic::median($data);
Mode, (*7)
Basic::mode($data);
Range, (*8)
Basic::range($data);
Percentage Change, (*9)
Basic::percentageChange($start_value, $end_value);
Percentage Difference, (*10)
Basic::percentageDifference($start_value, $end_value);
Absolute Error, (*11)
Error::absoluteError(0, 0);
Mean Absolute Error, (*12)
Error::mae($actuals, $predictions);
Mean Square Error, (*13)
Error::mse($actuals, $predictions);
Variance (population / sample), (*14)
Error::variance($data, true);
Error::variance($data, false);
Std, (*15)
Error::std($data);
Absolute / Relative / Cumulative Frequency for continuous values, (*16)
$frequency_classes = Frequency::frequencyContinuous($data);
$frequency_classes[$i]->absolute_frequency
$frequency_classes[$i]->relative_frequency
$frequency_classes[$i]->cumulative_frequency
Absolute / Relative / Cumulative Frequency for discrete values, (*17)
$frequency_classes = Frequency::frequencyDiscrete($data);
$frequency_classes[$i]->absolute_frequency
$frequency_classes[$i]->relative_frequency
$frequency_classes[$i]->cumulative_frequency
Simple Moving Average, (*18)
MovingAverage::simpleMovingAverage($moving_average_value, $data);
Exponential Moving Average, (*19)
MovingAverage::exponentialMovingAverage(moving_average_value, $data);
Outliers Around Mean, (*20)
Outliers::outlierAroundMean($data);
Outliers Around Median, (*21)
Outliers::outlierAroundMedian($data);