Stats.Percentile Method
Definition
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.9.0
Overload List
| Percentile(Double[], Int32) | Gets the specified percentile. |
| Percentile( | Gets the specified percentile. |
| Percentile<T>(Vector<T>, Int32, QuantileType) | Gets the specified percentile. |
Percentile(Double[], Int32)
public static double Percentile(
double[] values,
int percent
)Parameters
Return Value
DoubleThe percentile corresponding to the percentage specified by percent.
Remarks
If the percentile falls between two observations, it is interpolated between the adjacent observations.
Uses Weibull (Hyndman-Fan type 6). An empty sample returns NaN.
Exceptions
| Argument | values is null. |
| Argument | percent is less than zero or greater than 100. |
Percentile(Vector<Double>, Double)
public static double Percentile(
this Vector<double> values,
double percent
)Parameters
Return Value
DoubleThe percentile corresponding to the percentage specified by percent.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type Vector<Double>. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).Remarks
If the percentile falls between two observations, it is interpolated between the adjacent observations.
Uses Weibull (Hyndman-Fan type 6). Missing-aware vectors exclude missing observations; no observed values returns NaN.
Exceptions
| Argument | values is null. |
| Argument | percent is less than zero or greater than 100. |
Percentile<T>(Vector<T>, Int32, QuantileType)
public static T Percentile<T>(
this Vector<T> values,
int percent,
QuantileType type = QuantileType.R
)
Parameters
- values Vector<T>
- A Vector<T>.
- percent Int32
- An integer between 0 and 100, inclusive.
- type QuantileType (Optional)
- The type of quantile to compute.
Type Parameters
- T
Return Value
TThe percentile corresponding to the percentage specified by percent.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type Vector<T>. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).Remarks
If the percentile falls between two observations, it is interpolated between the adjacent observations.
Missing-aware vectors exclude missing observations; no observed values returns a missing result.
Exceptions
| Argument | values is null. |
| Argument | percent is less than zero or greater than 100. |