Skip to content

geodalib / core/src / deviationFromMean

Function: deviationFromMean() ​

deviationFromMean(data): Promise<number[]>

Defined in: core/src/data/deviation.ts:20

Calculate the deviation from the mean.

Note: The deviation from the mean is the difference between the mean and the data point.

Parameters ​

data ​

The data to calculate the deviation from the mean

number[] | Float32Array<ArrayBufferLike>

Returns ​

Promise<number[]>

The deviation from the mean

Example ​

ts
const data = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
const deviation = await deviationFromMean(data);
console.log(deviation);