Calculates the biased variance of a given vector's elements.
Namespace:
CenterSpace.NMath.CoreAssembly: NMath (in NMath.dll) Version: 5.1.0.0
Syntax
| C# |
|---|
public static float Variance( FloatVector v ) |
| Visual Basic (Declaration) |
|---|
Public Shared Function Variance ( _ v As FloatVector _ ) As Single |
| Visual C++ |
|---|
public: static float Variance( FloatVector^ v ) |
Parameters
- v
- Type: CenterSpace.NMath.Core..::.FloatVector
A vector.
Return Value
The biased variance of the elements in v.
Remarks
variance = (System.Math.pow(v[0] - mean, 2) + System.Math.pow(v[1] - mean, 2)) / n
Exceptions
| Exception | Condition |
|---|---|
| CenterSpace.NMath.Core..::.InvalidArgumentException | Thrown if v has zero length. |