Skip to main content
Module

x/simplestatistics/index.js>sumNthPowerDeviations

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

The sum of deviations to the Nth power. When n=2 it's the sum of squared deviations. When n=3 it's the sum of cubed deviations.

Examples

var input = [1, 2, 3]; // since the variance of a set is the mean squared // deviations, we can calculate that with sumNthPowerDeviations: sumNthPowerDeviations(input, 2) / input.length;

Parameters

x
n

power