int __stdcall NDK_SAD | ( | double * | X, |
double * | Y, | ||
size_t | N, | ||
double * | retVal | ||
) |
Calculates the sum of absolute errors (SAE) between the forecast and the eventual outcomes.
- 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 original (eventual outcomes) time series sample data (a one dimensional array). [in] Y is the forecast time series data (a one dimensional array). [in] N is the number of observations in X. [out] retVal is the calculated value of this function.
- Remarks
- 1. The time series is homogeneous or equally spaced.
- 2. The two time series must be identical in size.
- 3. A missing value (say \(x_k\) or \(\hat x_k\)) in either time series will exclude the data point \((x_k,\hat x_k)\) from the SSE.
- 4. The sum of absolute errors (SAE) or deviations (SAD), is defined as follows:
- \[\mathrm{SAE}=\mathrm{SAD}=\sum_{i=1}^N \left | x_i-\hat x_i \right |\],
- where:
- \(\{x_i\}\) is the actual observations time series.
- \(\{\hat x_i\}\) is the estimated or forecasted time series.
- Requirements
-
Header SFSDK.H Library SFSDK.LIB DLL SFSDK.DLL
- Examples
-
Namespace: | NumXLAPI |
Class: | SFSDK |
Scope: | Public |
Lifetime: | Static |
int NDK_SAD | ( | double[] | pData1, |
double[] | pData2, | ||
UIntPtr | nSize, | ||
ref double | retVal | ||
) |
Calculates the sum of absolute errors (SAE) between the forecast and the eventual outcomes.
- Return Value
-
a value from NDK_RETCODE enumeration for the status of the call.
NDK_SUCCESS operation successful Error Error Code
- Parameters
-
[in] pData1 is the original (eventual outcomes) time series sample data (a one dimensional array). [in] pData2 is the forecast time series data (a one dimensional array). [in] nSize is the number of observations in pData1. [out] retVal is the calculated value of this function.
- Remarks
- 1. The time series is homogeneous or equally spaced.
- 2. The two time series must be identical in size.
- 3. A missing value (say \(x_k\) or \(\hat x_k\)) in either time series will exclude the data point \((x_k,\hat x_k)\) from the SSE.
- 4. The sum of absolute errors (SAE) or deviations (SAD), is defined as follows:
- \[\mathrm{SAE}=\mathrm{SAD}=\sum_{i=1}^N \left | x_i-\hat x_i \right |\],
- where:
- \(\{x_i\}\) is the actual observations time series.
- \(\{\hat x_i\}\) is the estimated or forecasted time series.
- Exceptions
-
Exception Type Condition None N/A
- Requirements
-
Namespace NumXLAPI Class SFSDK Scope Public Lifetime Static Package NumXLAPI.DLL
- Examples
-
- References
- Hull, John C.; Options, Futures and Other DerivativesFinancial Times/ Prentice Hall (2011), ISBN 978-0132777421