Stats.PopulationVariance Method

Definition

Namespace: Numerics.NET.Statistics
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.9.0

Overload List

PopulationVariance<T>(Vector<T>) Returns the variance of the elements of a vector.
PopulationVariance<T>(T[], Boolean) Returns the variance of the elements of an array.
PopulationVariance<T>(IEnumerable<T>, Boolean) Returns the variance of the elements of an array.
PopulationVariance<T>(ReadOnlySpan<T>, Boolean) Returns the variance of the elements of a span.

PopulationVariance<T>(Vector<T>)

Returns the variance of the elements of a vector.
C#
public static double PopulationVariance<T>(
	this Vector<T> values
)

Parameters

values  Vector<T>
A vector.

Type Parameters

T
The type of the elements of values.

Return Value

Double
The variance of the elements of values.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Vector<T>. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

Exceptions

ArgumentNullException

values is null.

PopulationVariance<T>(T[], Boolean)

Returns the variance of the elements of an array.
C#
public static double PopulationVariance<T>(
	this T[] values,
	bool skipMissingValues = false
)

Parameters

values  T[]
An array of values.
skipMissingValues  Boolean  (Optional)
Optional. Specifies whether missing values should be excluded from the calculation. The default is false.

Type Parameters

T
The type of the elements of values.

Return Value

Double
The variance of the elements of values.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type T[]. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

Exceptions

ArgumentNullException

values is null.

PopulationVariance<T>(IEnumerable<T>, Boolean)

Returns the variance of the elements of an array.
C#
public static double PopulationVariance<T>(
	IEnumerable<T> values,
	bool skipMissingValues = false
)

Parameters

values  IEnumerable<T>
An object that implements IEnumerable<Double>.
skipMissingValues  Boolean  (Optional)
Optional. Specifies whether missing values should be excluded from the calculation. The default is false.

Type Parameters

T
The type of the elements of values.

Return Value

Double
The variance of the elements of values.

Remarks

Population variance divides the sum of squared deviations by the number of observed values.

No observed values returns NaN; one finite observed value returns zero.

Exceptions

ArgumentNullException

values is null.

PopulationVariance<T>(ReadOnlySpan<T>, Boolean)

Returns the variance of the elements of a span.
C#
public static double PopulationVariance<T>(
	this ReadOnlySpan<T> values,
	bool skipMissingValues = false
)

Parameters

values  ReadOnlySpan<T>
A span of values.
skipMissingValues  Boolean  (Optional)
Optional. Specifies whether missing values should be excluded from the calculation. The default is false.

Type Parameters

T
The type of the elements of values.

Return Value

Double
The variance of the elements of values.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type ReadOnlySpan<T>. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

See Also