Calculate standard deviation.

Namespace:  AForge.Math
Assembly:  AForge.Math (in AForge.Math.dll) Version: 2.2.5.0 (2.2.5.0)

Syntax

C#
public static double StdDev(
	int[] values
)

Parameters

values
Type: array< System..::.Int32 >[]()[]
Histogram array.

Return Value

Returns value of standard deviation.

Remarks

The input array is treated as histogram, i.e. its indexes are treated as values of stochastic function, but array values are treated as "probabilities" (total amount of hits).

Sample usage:

CopyC#
// create histogram array
int[] histogram = new int[] { 1, 1, 2, 3, 6, 8, 11, 12, 7, 3 };
// calculate standard deviation value
double stdDev = Statistics.StdDev( histogram );
// output it (1.999)
Console.WriteLine( "std.dev. = " + stdDev.ToString( "F3" ) );

See Also