Skip to main content
Module

x/statistics/mod.ts>rootMeanSquare

Deno basic statistics module.
Latest
function rootMeanSquare
import { rootMeanSquare } from "https://deno.land/x/statistics@v0.1.1/mod.ts";

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 on O(n), linear time in respect to the array

Examples

rootMeanSquare([-1, 1, -1, 1]); // => 1

Parameters

x: number[]

a sample of one or more data points

Returns

number

root mean square