MathPHP\Statistics\Correlation::covariance PHP Метод

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

A measure of how much two random variables change together. Average product of their deviations from their respective means. The population covariance is defined in terms of the sample means x, y https://en.wikipedia.org/wiki/Covariance
public static covariance ( array $X, array $Y, boolean $population = false ) : number
$X array values for random variable X
$Y array values for random variable Y
$population boolean
Результат number
    public static function covariance(array $X, array $Y, bool $population = false)
    {
        return $population ? self::populationCovariance($X, $Y) : self::sampleCovariance($X, $Y);
    }