Overload List
| # | Signature | Description |
|---|---|---|
| 1 | procedure TripleExpSmooth(const Y: TVec; const S: TVec; const B: TVec; const L: TVec; const Alpha: Double; const Beta: Double; const Gamma: Double; out MSE: Double; const Period: Integer); | In this case a fixed smoothing constants Alpha, Beta and Gamma are used in smoothing equations (no minimization is performed). |
| 2 | function TripleExpSmooth(const Y: TVec; const S: TVec; const B: TVec; const L: TVec; var Alpha: Double; var Beta: Double; var Gamma: Double; const Period: Integer): Double; | Triple exponential smoothing. |
Overload 1: procedure TripleExpSmooth(const Y: TVec; const S: TVec; const B: TVec; const L: TVec; const Alpha: Double; const Beta: Double; const Gamma: Double; out MSE: Double; const Period: Integer);
In this case a fixed smoothing constants Alpha, Beta and Gamma are used in smoothing equations (no minimization is performed).
| # | Name | Description |
|---|---|---|
| 1 | MSE | Returns MSE, evaluated for constant Alpha, Beta and Gamma. |
| 2 | Y | Time series data set. |
| 3 | S | Smoothed values (see above equation). Size and complex properties of S are set automatically. |
| 4 | B | Trend values (see above equation). Size and complex properties of b are set automatically. |
| 5 | L | Seasonal indices (see above equation). Size and complex properties of L are set automatically. |
| 6 | Alpha | Defines initial estimate for Alpha, returns Alpha which minimizes MSE. |
| 7 | Beta | Defines initial estimate for Beta, returns Beta which minimizes MSE. |
| 8 | Gamma | Defines initial estimate for Gamma, returns Gamma which minimizes MSE. |
| 9 | Period | Period length. An exception is raised if Y.Length mod Period is not 0. |
Result: stored in self (calling object)
Overload 2: function TripleExpSmooth(const Y: TVec; const S: TVec; const B: TVec; const L: TVec; var Alpha: Double; var Beta: Double; var Gamma: Double; const Period: Integer): Double;
Triple exponential smoothing.
| # | Name | Description |
|---|---|---|
| 1 | Y | Time series data set. |
| 2 | S | Smoothed values (see above equation). Size and complex properties of S are set automatically. |
| 3 | B | Trend values (see above equation). Size and complex properties of b are set automatically. |
| 4 | L | Seasonal indices (see above equation). Size and complex properties of L are set automatically. |
| 5 | Alpha | Defines initial estimate for Alpha, returns Alpha which minimizes MSE. |
| 6 | Beta | Defines initial estimate for Beta, returns Beta which minimizes MSE. |
| 7 | Gamma | Defines initial estimate for Gamma, returns Gamma which minimizes MSE. |
| 8 | Period | Period length. An exception is raised if Y.Length mod Period is not 0. |
Returns: Double - MSE, evaluated at minimum.
Performs triple exponential smoothing (also known as Holt-Winters smoothing) using the following equations:
where Y are the observations, S are the smoothed observations, b trend factors, L the seasonal indices and P is the period length. To initialize triple exponential smoothing method we need at least one complete season's data to determine initial estimates of the seasonal indices L0]..L[P-1]. Again, there are several ways to initialize L values. The algorithm uses approach, described at [www.itl.nist.gov/div898/handbook/pmc/section4/pmc435.htm page. For initial estimate for S and b, the following equations are being used:
Note
There are no S[0]..S[P-2] values; the smoothed series starts with the smoothed version of the Y[P] observation. Also note that the internal algorithm automatically accounts for this by resizing S,b vector to Y.Length-Period.
Uses MtxExpr,StatTimeSerAnalysis, Math387;
procedure Example;
var Data,S,b,L: Vector;
Alpha,Beta,Gamma,MSE: double;
begin
Data.Size(24,false);
Data.RandGauss;
// smooth data, initial alpha = 0.1, beta=0.1, gamma = 0.3
Alpha := 0.1;
Beta := 0.1;
Gamma := 0.3;
// Period = 4
MSE := TripleExpSmooth(Data,S,b,L,Alpha,Beta,Gamma,4);
// results: MSE and MLE estimate for Alpha,Beta,Gamma
end;