# NDK_DESMTH

 int __stdcall NDK_DESMTH ( double * pData, size_t nSize, BOOL bAscending, double * alpha, double * beta, int xlHorizon, BOOL bOptimize, double * retVal )

Returns the (Holt-Winter's) double exponential smoothing estimate of the value of X at time T+m.

Returns
status code of the operation
Return values
 NDK_SUCCESS Operation successful NDK_FAILED Operation unsuccessful. See Macros for full list.
Parameters
 [in] pData is the univariate time series data (a one dimensional array). [in] nSize is the number of elements in pData. [in] bAscending is the time order in the data series (i.e. the first data point's corresponding date (earliest date=1 (default), latest date=0)). [in] alpha is the data smoothing factor (alpha should be between zero and one (exclusive)). [in] beta is the trend smoothing factor (beta should be between zero and one (exclusive)). [in] xlHorizon is the forecast time horizon beyond the end of X. If missing, a default value of 0 (latest or end of X) is assumed. [in] bOptimize is a flag (True/False) for searching and using the optimal value of the smoothing factor. If missing or omitted, optimize is assumed false. [out] retVal is the calculated value of this function.
Remarks
1. The double exponential smoothing function $$F_{T+m}$$ is defined as follow: $S_1=Y_1$ $B_1=\frac{Y_T-Y_1}{T-1}$ $S_{t\succ 1}= \alpha\times Y_{t} + (1-\alpha)\times (S_{t-1} + B_{t-1})$ $B_{t\succ 1}=\beta (S_t-S_{t-1})+(1-\beta)\times B_{t-1}$ $F_t=S_t+ B_t$ $F_{T+m}=S_T+m\times B_T$ Where:
• $$X_t$$ is the value of the time series at time t.
• $$T$$ is the time of the latest observation in the sample data.
• $$\alpha$$ is the smoothing factor.
• $$\beta$$ is the trend smoothing factor.
• $$F_{T+m}$$ is the output of the algorithm at m steps past the end of the sample.
2. To search for the optimal values of the smoothing factors (i.e. alpha and Beta), the time series must have three (3) or more non-missing observations.
3. The time series is homogeneous or equally spaced.
4. The time series may include missing values (e.g. NaN) at either end.
Requirements
Header SFSDK.H SFSDK.LIB SFSDK.DLL
Examples



 Namespace: NumXLAPI Class: SFSDK Scope: Public Lifetime: Static
 int NDK_DESMTH ( double[] pData, int nSize, BOOL bAscending, ref double alpha, ref double beta, int xlHorizon, BOOL bOptimize, ref double retVal )

Returns the (Holt-Winter's) double exponential smoothing estimate of the value of X at time T+m.

Returns
status code of the operation
Return values
 NDK_SUCCESS Operation successful NDK_FAILED Operation unsuccessful. See Macros for full list.
Parameters
 [in] pData is the univariate time series data (a one dimensional array). [in] nSize is the number of elements in pData. [in] bAscending is the time order in the data series (i.e. the first data point's corresponding date (earliest date=1 (default), latest date=0)). [in] alpha is the data smoothing factor (alpha should be between zero and one (exclusive)). [in] beta is the trend smoothing factor (beta should be between zero and one (exclusive)). [in] xlHorizon is the forecast time horizon beyond the end of X. If missing, a default value of 0 (latest or end of X) is assumed. [in] bOptimize is a flag (True/False) for searching and using the optimal value of the smoothing factor. If missing or omitted, optimize is assumed false. [out] retVal is the calculated value of this function.
Remarks
1. The double exponential smoothing function $$F_{T+m}$$ is defined as follow: $S_1=Y_1$ $B_1=\frac{Y_T-Y_1}{T-1}$ $S_{t\succ 1}= \alpha\times Y_{t} + (1-\alpha)\times (S_{t-1} + B_{t-1})$ $B_{t\succ 1}=\beta (S_t-S_{t-1})+(1-\beta)\times B_{t-1}$ $F_t=S_t+ B_t$ $F_{T+m}=S_T+m\times B_T$ Where:
• $$X_t$$ is the value of the time series at time t.
• $$T$$ is the time of the latest observation in the sample data.
• $$\alpha$$ is the smoothing factor.
• $$\beta$$ is the trend smoothing factor.
• $$F_{T+m}$$ is the output of the algorithm at m steps past the end of the sample.
2. To search for the optimal values of the smoothing factors (i.e. alpha and Beta), the time series must have three (3) or more non-missing observations.
3. The time series is homogeneous or equally spaced.
4. The time series may include missing values (e.g. NaN) at either end.
Exceptions
Exception Type Condition
None N/A
Requirements
Namespace NumXLAPI SFSDK Public Static 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