NDK_SESMTH

int __stdcall NDK_SESMTH ( double *  pData,
size_t  nSize,
BOOL  bAscending,
double *  alpha,
int  nHorizon,
BOOL  bOptimize,
double *  retVal 
)

Returns the (Brown's) simple exponential (EMA) smoothing estimate of the value of pData at time t+m (based on the raw data up to time t).

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 smoothing factor (alpha should be between zero and one (exclusive)). If missing or omitted, a value of 0.333 is used.
[in] nHorizon is the forecast time horizon beyond the end of pData. If missing, a default value of 0 (latest or end of pData) 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 simple exponential smoothing function \(S_t\) is defined as follow: \[S_1=X_1 \] \[S_{t \succ 1}= \alpha\times X_{t-1} + (1-\alpha)\times S_{t-1} \] \[S_{t \succ T}=S_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.
  2. The time series is homogeneous or equally spaced.
  3. The time series may include missing values (e.g. NaN) at either end.
  4. Exponential smoothing and moving average are similar in that they both assume a stationary, not trending, time series.
  5. If a trend exists in the time series, the simple exponential lags behind the trend.
  6. To search for the optimal values of the smoothing factor (alpha), the time series must have two(2) or more non-missing observations.
  7. The exponential smoothing function differs from the weighted moving average (WMA) in that exponential smoothing takes into account all past data, whereas moving average only takes into account k past data points.
Requirements
Header SFSDK.H
Library SFSDK.LIB
DLL SFSDK.DLL
Examples


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

Returns the (Brown's) simple exponential (EMA) smoothing estimate of the value of X at time t+m (based on the raw data up to time t).

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 smoothing factor (alpha should be between zero and one (exclusive)). If missing or omitted, a value of 0.333 is used.
[in] nHorizon is the forecast time horizon beyond the end of pdata. If missing, a default value of 0 (latest or end of pdata) 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 simple exponential smoothing function \(S_t\) is defined as follow: \[S_1=X_1 \] \[S_{t \succ 1}= \alpha\times X_{t-1} + (1-\alpha)\times S_{t-1} \] \[S_{t \succ T}=S_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.
  2. The time series is homogeneous or equally spaced.
  3. The time series may include missing values (e.g. NaN) at either end.
  4. Exponential smoothing and moving average are similar in that they both assume a stationary, not trending, time series.
  5. If a trend exists in the time series, the simple exponential lags behind the trend.
  6. To search for the optimal values of the smoothing factor (alpha), the time series must have two(2) or more non-missing observations.
  7. The exponential smoothing function differs from the weighted moving average (WMA) in that exponential smoothing takes into account all past data, whereas moving average only takes into account k past data points.
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