FinMath.Percentile Method

Calculates percentiles
public static double Percentile( 
double Level
double[] Data
int Method = 0 
)
This language is not supported or no code example is available.
public:  
static double Percentile( 
double Level
array< double >^ Data
int Method 
)
This language is not supported or no code example is available.
public static function Percentile( 
Level : double
Data : double[], 
Method : int 
) : double;
This language is not supported or no code example is available.

Parameters

Level
double

Percentile value between 0 and 100

Data
double[]

Array of data

Method
int

Percentile method: 0(default) - Excel, 1 - nearest-rank method, 2 - old method

Return Value

double
Remarks
 
Percentile is a measure of location in a distribution of numbers, that defines the value below which a given percentage of the data falls. For example, the 90th percentile is the point below which 90 percent of the data falls.
Example
 
 double[] Data = new double[5];
 	
 Data[0] = 15.00;
 Data[1] = 20.00;
 Data[2] = 35.00;
 Data[3] = 40.00;
 Data[4] = 50.00;
 	
 Console.WriteLine("Percentile = " + FinMath.Percentile(40, Data));
 					
You should get 29 for method = 0

In this article

Definition