
public static DoubleMatrix Kurtosis(
	DoubleMatrix data,
	bool adjustForBias,
	DataOperation dataOperation
)Public Shared Function Kurtosis ( 
	data As DoubleMatrix,
	adjustForBias As Boolean,
	dataOperation As DataOperation
) As DoubleMatrixpublic:
static DoubleMatrix^ Kurtosis(
	DoubleMatrix^ data, 
	bool adjustForBias, 
	DataOperation dataOperation
)static member Kurtosis : 
        data : DoubleMatrix * 
        adjustForBias : bool * 
        dataOperation : DataOperation -> DoubleMatrix 
            The kurtosis of a random variable  
            can be defined as follows:
            
        
            where  and 
            
 are         
            the cumulants of order 2 and 4, respectively, and 
            
        
            is the  central moment 
            of order 
.
            
            By interpreting the rows or the columns 
            of data as samples drawn from
            random variables, this method returns the kurtosis 
            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 kurtosis of the i-th 
            data row, say 
            The   parameter can be 
            estimated through the coefficient
            
            where
            
            is the sample -th central moment of the 
            i-th row.
            
            Note that  is
            undefined if the standard deviation 
            of the i-th row of data is zero.
            
            The statistic  is  
            a biased estimator of 
            However, provided that the number of 
            columns in data is greater than 3,
            it can be corrected for bias and the corresponding kurtosis 
            evaluated through the coefficient
            
            If adjustForBias is set to false, 
            then  is estimated 
            through 
 if it is 
            defined, otherwise the i-th position in the returned 
            value evaluates to NaN.  
            
If adjustForBias is set to true, then this method operates as follows.
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 kurtosis of 
            the j-th 
            data column, 
            say 
            The  parameter 
            can be estimated through the coefficient
            
            where
            
            is the sample -th central
            moment of the j-th column.
            
            Note that  is
            undefined if the standard deviation 
            of the j-th column of data is zero.
            
            The statistic  is 
            a biased estimator of 
.
            However, provided that the number of 
            rows in data is greater than 3,
            it can be corrected for bias and the corresponding kurtosis 
            evaluated through the coefficient
            
            If adjustForBias is set to false, 
            then  is estimated 
            through 
 if it is 
            defined, otherwise the j-th position in the returned 
            value evaluates to NaN.  
            
If adjustForBias is set to true, then this method operates as follows.
In the following example, row and column kurtosis estimates in a data matrix are computed.
using System;
namespace Novacta.Analytics.CodeExamples
{
    public class KurtosisExample0  
    {
        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);
            // Kurtosis can be adjusted for bias.
            bool adjustForBias = true;
            // Compute the kurtosis on columns.
            var kurtosisOnColumns = Stat.Kurtosis(matrix, adjustForBias, DataOperation.OnColumns);
            Console.WriteLine();
            Console.WriteLine("Kurtosis on columns:");
            Console.WriteLine(kurtosisOnColumns);
            // Kurtosis is overloaded to accept data as a read-only matrix:
            // compute the kurtosis on rows using a read-only wrapper of the data matrix.
            ReadOnlyDoubleMatrix readOnlyMatrix = matrix.AsReadOnly();
            var kurtosisOnRows = Stat.Kurtosis(readOnlyMatrix, adjustForBias, DataOperation.OnRows);
            Console.WriteLine();
            Console.WriteLine("Kurtosis on rows:");
            Console.WriteLine(kurtosisOnRows);
        }
    }
}
// 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               
// 
// 
// 
// Kurtosis on columns:
// 1.16566634       NaN              1.2821471        0.757655955      -5.07072         
// 
// 
// 
// Kurtosis on rows:
// -0.22506045      
// 3.37802768       
// 1.9340679        
// -1.46435105      
// 
//| ArgumentNullException | data is null. | 
| ArgumentException | dataOperation is not a field of 
            DataOperation. -or- adjustForBias is true, dataOperation is OnRows and the number of columns of data is less than 4. -or- adjustForBias is true, dataOperation is OnColumns and the data number of rows is less than 4. |