int __stdcall NDK_LESMTH | ( | double * | pData, |
size_t | nSize, | ||
BOOL | bAscending, | ||
double * | alpha, | ||
int | xlHorizon, | ||
BOOL | bOptimize, | ||
double * | retVal | ||
) |
Returns the (Brown's) linear exponential 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] xlHorizon is the forecast time horizon beyond the end of pData. 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
-
- The Brown's Linear exponential smoothing function \(F_{T+m}\) is defined as: \[S'_1 = X_1 \] \[S''_1 = X_1 \] \[S'_{t>1} = \alpha X_{t} + (1-\alpha)S'_{t-1}\] \[S''_{t>1} = \alpha S'_{t} + (1-\alpha)S''_{t-1}\] \[a_t = 2S'_t - S''_t\] \[b_t = \frac{\alpha}{1-\alpha}\times (S'_t - S''_t)\] \[F_{T+m} = a_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.
- \(m\) is the estimate time/horizon (past the end of raw data).
- To search for the optimal value of the smoothing factor (alpha), the time series must have two(2) or more non-missing observations.
- The time series is homogeneous or equally spaced.
- The time series may include missing values (e.g. NaN) at either end.
- The Brown's Linear exponential smoothing function \(F_{T+m}\) is defined as: \[S'_1 = X_1 \] \[S''_1 = X_1 \] \[S'_{t>1} = \alpha X_{t} + (1-\alpha)S'_{t-1}\] \[S''_{t>1} = \alpha S'_{t} + (1-\alpha)S''_{t-1}\] \[a_t = 2S'_t - S''_t\] \[b_t = \frac{\alpha}{1-\alpha}\times (S'_t - S''_t)\] \[F_{T+m} = a_T + m\times b_T\] Where:
- Requirements
-
Header SFSDK.H Library SFSDK.LIB DLL SFSDK.DLL
- Examples
-
Namespace: | NumXLAPI |
Class: | SFSDK |
Scope: | Public |
Lifetime: | Static |
int NDK_LESMTH | ( | double[] | pData, |
int | nSize, | ||
BOOL | bAscending, | ||
double * | alpha, | ||
int | xlHorizon, | ||
BOOL | bOptimize, | ||
ref double | retVal | ||
) |
Returns the (Brown's) linear exponential 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] 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
-
- The Brown's Linear exponential smoothing function \(F_{T+m}\) is defined as: \[S'_1 = X_1 \] \[S''_1 = X_1 \] \[S'_{t>1} = \alpha X_{t} + (1-\alpha)S'_{t-1}\] \[S''_{t>1} = \alpha S'_{t} + (1-\alpha)S''_{t-1}\] \[a_t = 2S'_t - S''_t\] \[b_t = \frac{\alpha}{1-\alpha}\times (S'_t - S''_t)\] \[F_{T+m} = a_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.
- \(m\) is the estimate time/horizon (past the end of raw data).
- To search for the optimal value of the smoothing factor (alpha), the time series must have two(2) or more non-missing observations.
- The time series is homogeneous or equally spaced.
- The time series may include missing values (e.g. NaN) at either end.
- The Brown's Linear exponential smoothing function \(F_{T+m}\) is defined as: \[S'_1 = X_1 \] \[S''_1 = X_1 \] \[S'_{t>1} = \alpha X_{t} + (1-\alpha)S'_{t-1}\] \[S''_{t>1} = \alpha S'_{t} + (1-\alpha)S''_{t-1}\] \[a_t = 2S'_t - S''_t\] \[b_t = \frac{\alpha}{1-\alpha}\times (S'_t - S''_t)\] \[F_{T+m} = a_T + m\times b_T\] Where:
- 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