public static DoubleMatrix StandardDeviation(
	DoubleMatrix data,
	bool adjustForBias,
	DataOperation dataOperation
)Public Shared Function StandardDeviation ( 
	data As DoubleMatrix,
	adjustForBias As Boolean,
	dataOperation As DataOperation
) As DoubleMatrixpublic:
static DoubleMatrix^ StandardDeviation(
	DoubleMatrix^ data, 
	bool adjustForBias, 
	DataOperation dataOperation
)static member StandardDeviation : 
        data : DoubleMatrix * 
        adjustForBias : bool * 
        dataOperation : DataOperation -> DoubleMatrix 
            The standard deviation of a random variable  
            can be defined as follows:
            
        
            where
            
        
            is the  central moment 
            of order 
.
            
            By interpreting rows or columns of data as samples drawn from
            random variables, this method returns the standard deviation estimates of such variables.
            Let  and  
            
 be the data
            number of rows and columns, respectively, and define
            
Operating on rows
If dataOperation is OnRows, then the method returns a column vector whose length equals the number of rows of data. The i-th entry of such column returns the standard deviation of the i-th data row.
            If adjustForBias is set to false, then 
            the standard deviation of the i-th row is estimated through 
            the coefficient
            
            where
            
            is the sample -th central moment of the 
            i-th row.
            
            Such estimator is biased. If adjustForBias is set to true, then 
            the variance estimator is corrected for bias
            and the i-th standard deviation is evaluated through the coefficient
            
Operating on columns
If dataOperation is OnColumns, then the method returns a row vector whose length is the data number of columns. The j-th entry of the returned row exposes the standard deviation of the j-th data column.
            If adjustForBias is set to false, then 
            the standard deviation of the j-th column is estimated through 
            the coefficient
            
            where
            
            is the sample -th central moment of the 
            j-th column.
            
            Such estimator is biased. If adjustForBias is set to true, 
            then the variance estimator is corrected for bias
            and the j-th standard deviation is evaluated through the coefficient
            
In the following example, row and column standard deviation estimates in a data matrix are computed.
using System;
namespace Novacta.Analytics.CodeExamples
{
    public class StandardDeviationExample0  
    {
        public void Main()
        {
            // Create a matrix.
            var data = new double[20] {
                1, 2, -3,  6, -2,
                2, 2,  2,  0,  7,
               -3, 2,  3,  2,  9,
                5, 2,  7, -1, -4
            };
            var matrix = DoubleMatrix.Dense(4, 5, data, StorageOrder.RowMajor);
            Console.WriteLine("The data matrix:");
            Console.WriteLine(matrix);
            // StandardDeviation can be adjusted for bias.
            bool adjustForBias = true;
            // Compute the standard deviation on columns.
            var stdDevOnColumns = Stat.StandardDeviation(matrix, adjustForBias, DataOperation.OnColumns);
            Console.WriteLine();
            Console.WriteLine("StandardDeviation on columns:");
            Console.WriteLine(stdDevOnColumns);
            // StandardDeviation is overloaded to accept data as a read-only matrix:
            // compute the standard deviation on rows using a read-only wrapper of the data matrix.
            ReadOnlyDoubleMatrix readOnlyMatrix = matrix.AsReadOnly();
            var stdDevOnRows = Stat.StandardDeviation(readOnlyMatrix, adjustForBias, DataOperation.OnRows);
            Console.WriteLine();
            Console.WriteLine("StandardDeviation on rows:");
            Console.WriteLine(stdDevOnRows);
        }
    }
}
// Executing method Main() produces the following output:
// 
// The data matrix:
// 1                2                -3               6                -2               
// 2                2                2                0                7                
// -3               2                3                2                9                
// 5                2                7                -1               -4               
// 
// 
// 
// StandardDeviation on columns:
// 3.30403793       0                4.11298756       3.09569594       6.45497224       
// 
// 
// 
// StandardDeviation on rows:
// 3.56370594       
// 2.60768096       
// 4.27784993       
// 4.4384682        
// 
//| ArgumentNullException | data is null. | 
| ArgumentException | dataOperation is not a field of 
            DataOperation. -or adjustForBias is true, dataOperation is OnRows and the data number of columns is less than 2. -or- adjustForBias is true, dataOperation is OnColumns and the data number of rows is less than 2.  |