MathPHP\Statistics\Average::rootMeanSquare PHP Метод

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

https://en.wikipedia.org/wiki/Root_mean_square ___________ x₁+²x₂²+ ⋯ x rms = / ----------- √ n
public static rootMeanSquare ( array $numbers ) : number
$numbers array
Результат number
    public static function rootMeanSquare(array $numbers)
    {
        $x₁²+x₂²+⋯ = array_sum(array_map(function ($x) {
            return $x ** 2;
        }, $numbers));
        $n = count($numbers);
        return sqrt($x₁²+x₂²+⋯ / $n);
    }