Skip to main content
Module

x/simplestatistics/index.js>mean

simple statistics for node & browser javascript
Go to Latest
function mean
import { mean } from "https://deno.land/x/simplestatistics@v7.7.5/index.js";

The mean, also known as average, is the sum of all values over the number of values. This is a measure of central tendency: a method of finding a typical or central value of a set of numbers.

This runs in O(n), linear time, with respect to the length of the array.

Examples

mean([0, 10]); // => 5

Parameters

x

sample of one or more data points