NDK_QUANTILE

int __stdcall NDK_QUANTILE ( double *  X,
size_t  N,
double  p,
double *  retVal 
)

Returns the sample p-quantile of the non-missing observations (i.e. divides the sample data into equal parts determined by the percentage p).

Returns
status code of the operation
Return values
NDK_SUCCESS Operation successful
NDK_FAILED Operation unsuccessful. See Macros for full list.
Parameters
[in] X is the input data sample (a one dimensional array).
[in] N is the number of observations in X.
[in] p is a scalar value between 0 and 1 (exclusive).
[out] retVal is the calculated p-th quantile value.
Remarks
1. The time series may include missing values (NaN), but they will not be included in the calculations.
2. The quantile function for any distribution is defined between 0 and 1. Its function is the inverse of the cumulative distribution function (CDF).
3. The quantile function returns the sample median when \(p=0.5\).
4. The quantile function returns the sample minimum when \(p=0\).
5. The quantile function returns the sample maximum when \(p=1\).
6. For any probability distribution, the following holds true for the probability \(p\):
  • \(P(X< q)\geq p\), where:
    • \(q\) is the sample \(p\)-quantile.
Requirements
Header SFSDK.H
Library SFSDK.LIB
DLL SFSDK.DLL
Examples


   
Namespace:  NumXLAPI
Class:  SFSDK
Scope:  Public
Lifetime:  Static
int NDK_QUANTILE ( double[]   pData,
UIntPtr  nSize,
double  argPct,
ref double  retVal 
)

Returns the sample p-quantile of the non-missing observations (i.e. divides the sample data into equal parts determined by the percentage p).

Return Value

a value from NDK_RETCODE enumeration for the status of the call. 

NDK_SUCCESS  operation successful
Error  Error Code
Parameters
[in] pData is the input data sample (a one dimensional array).
[in] nSize is the number of observations in pData.
[in] argPct is a scalar value between 0 and 1 (exclusive).
[out] retVal is the calculated p-th quantile value.
Remarks
1. The time series may include missing values (NaN), but they will not be included in the calculations.
2. The quantile function for any distribution is defined between 0 and 1. Its function is the inverse of the cumulative distribution function (CDF).
3. The quantile function returns the sample median when \(p=0.5\).
4. The quantile function returns the sample minimum when \(p=0\).
5. The quantile function returns the sample maximum when \(p=1\).
6. For any probability distribution, the following holds true for the probability \(p\):
  • \(P(X< q)\geq p\), where:
    • \(q\) is the sample \(p\)-quantile.
Exceptions
Exception Type Condition
None N/A
Requirements
Namespace NumXLAPI
Class SFSDK
Scope Public
Lifetime Static
Package NumXLAPI.DLL
Examples

	
References
* Hamilton, J .D.; Time Series Analysis , Princeton University Press (1994), ISBN 0-691-04289-6
* Tsay, Ruey S.; Analysis of Financial Time Series John Wiley & SONS. (2005), ISBN 0-471-690740
* D. S.G. Pollock; Handbook of Time Series Analysis, Signal Processing, and Dynamics; Academic Press; Har/Cdr edition(Nov 17, 1999), ISBN: 125609906
* Box, Jenkins and Reisel; Time Series Analysis: Forecasting and Control; John Wiley & SONS.; 4th edition(Jun 30, 2008), ISBN: 470272848