Function reference · Statistics

variance

Computes the population variance.

variance takes the mean squared deviation from the arithmetic mean, dividing by the total number of values. Use smpvar for the sample variance with an n-1 denominator.

Both the notation function and the direct nerdamer/statistics export accept separate values or one vector.

Examples

These examples use Nerdamer Notation.

Compute an exact population variance.

variance(1,2,3)
// → 2/3

Interfaces

The same operation is available through the interfaces below.

Nerdamer Notation · nerdamer API · Direct API

Nerdamer Notation

Use this form inside input passed to nerdamer(...).

variance(arg1, ...)

nerdamer.variance

Call the operation through the default nerdamer import.

nerdamer.variance(...args: StatisticsInput[]): Expression

Parameters

NameTypeDescription
argsStatisticsInput[]—

Returns

Expression

Browse the nerdamer API →

Direct JavaScript / TypeScript API

Import the operation directly from its package entry point.

import { variance } from 'nerdamer/statistics';
variance(...args: StatisticsInput[]): Expression

Parameters

NameTypeDescription
argsStatisticsInput[]—

Returns

Expression

Browse nerdamer/statistics →

← Back to Function reference