rootMeanSquare
rootMeanSquare(
x):number
Defined in: src/root_mean_square.js:15
The Root Mean Square (RMS) is
a mean function used as a measure of the magnitude of a set
of numbers, regardless of their sign.
This is the square root of the mean of the squares of the
input numbers.
This runs in O(n), linear time, with respect to the length of the array.
Parameters
Section titled “Parameters”number[]
a sample of one or more data points
Returns
Section titled “Returns”number
root mean square
Throws
Section titled “Throws”if x is empty
Example
Section titled “Example”rootMeanSquare([-1, 1, -1, 1]); // => 1