int __stdcall NDK_MAD ( double * X, size_t N, WORD reserved, double * retVal )

Returns the sample median of absolute deviation (MAD).

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/two dimensional array). [in] N is the number of observations in X. [in] reserved This parameter is reserved and must be 1. [out] retVal is the calculated value of this function.
Remarks
1. The input data series may include missing values (NaN), but they will not be included in the calculations.
2. The median of absolute deviation (MAD) is defined as follows:
$\operatorname{MAD} = \operatorname{median}_{i}\left(\ \left| X_{i} - \operatorname{median}_{j} (X_{j}) \right|\ \right)$
3. In short, starting with the deviations from the data's median, the MAD is the median of their absolute values.
4. The median of absolute deviation (MAD) is a measure of statistical dispersion.
5. MAD is a more robust estimator of scale than the sample variance or standard deviation.
6. MAD is especially useful with distributions that have neither mean nor variance (e.g. the Cauchy distribution.)
7. MAD is a robust statistic because it is less sensitive to outliers in a data series than standard deviation.
Requirements
Examples


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

Returns the sample median of absolute deviation (MAD).

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/two dimensional array). [in] nSize is the number of observations in pData. [in] argMenthod This parameter is reserved and must be 1. [out] retVal is the calculated value of this function.
Remarks
1. The input data series may include missing values (NaN), but they will not be included in the calculations.
2. The median of absolute deviation (MAD) is defined as follows:
$\operatorname{MAD} = \operatorname{median}_{i}\left(\ \left| X_{i} - \operatorname{median}_{j} (X_{j}) \right|\ \right)$
3. In short, starting with the deviations from the data's median, the MAD is the median of their absolute values.
4. The median of absolute deviation (MAD) is a measure of statistical dispersion.
5. MAD is a more robust estimator of scale than the sample variance or standard deviation.
6. MAD is especially useful with distributions that have neither mean nor variance (e.g. the Cauchy distribution.)
7. MAD is a robust statistic because it is less sensitive to outliers in a data series than standard deviation.
Exceptions
Exception Type Condition
None N/A
Requirements
Namespace NumXLAPI SFSDK Public Static NumXLAPI.DLL
Examples

References
Hull, John C.; Options, Futures and Other DerivativesFinancial Times/ Prentice Hall (2011), ISBN 978-0132777421
Hamilton, J .D.; Time Series Analysis , Princeton University Press (1994), ISBN 0-691-04289-6