StatTimeSerAnalysis::TripleExpSmooth Function

Overload List

#SignatureDescription
1double TripleExpSmooth(TVec *Y, TVec *S, TVec *B, TVec *L, double &Alpha, double &Beta, double &Gamma, const int Period);Triple exponential smoothing.
2void TripleExpSmooth(TVec *Y, TVec *S, TVec *B, TVec *L, const double Alpha, const double Beta, const double Gamma, double &MSE, const int Period);In this case a fixed smoothing constants Alpha, Beta and Gamma are used in smoothing equations (no minimization is performed).

Overload 1: double TripleExpSmooth(TVec *Y, TVec *S, TVec *B, TVec *L, double &Alpha, double &Beta, double &Gamma, const int Period);

Triple exponential smoothing.

#NameTypeDescription
1YTVec *Time series data set.
2STVec *Smoothed values (see above equation). Size and complex properties of S are set automatically.
3BTVec *Trend values (see above equation). Size and complex properties of b are set automatically.
4LTVec *Seasonal indices (see above equation). Size and complex properties of L are set automatically.
5Alphadouble &Defines initial estimate for Alpha, returns Alpha which minimizes MSE.
6Betadouble &Defines initial estimate for Beta, returns Beta which minimizes MSE.
7Gammadouble &Defines initial estimate for Gamma, returns Gamma which minimizes MSE.
8Periodconst intPeriod length. An exception is raised if Y.Length mod Period is not 0.

Returns: MSE, evaluated at minimum.

Remarks:

Performs triple exponential smoothing (also known as Holt-Winters smoothing) using the following equations:

S[i]=αY[i]L[iP]+(1α)(S[i1]+b[i1]),overral smoothingb[i]=γ(S[i]S[i1])+(1γ)b[i1],trend smoothingL[i]=βY[i]S[i]+(1β)L[iP],seasonal smoothing\begin{aligned} S[i] &= \alpha \cfrac{Y[i]}{L[i-P]} + (1-\alpha)\left(S[i-1]+b[i-1]\right) \quad , \quad \text {overral smoothing} \\ b[i] &= \gamma \left( S[i]-S[i-1]\right) + (1-\gamma)b[i-1] \quad , \quad \text{trend smoothing} \\ L[i] &= \beta \cfrac{Y[i]}{S[i]} + (1-\beta)L[i-P] \quad , \quad \quad \text{seasonal smoothing} \end{aligned}

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:

S[P1]=1Pi=0P1Y[i],b[P1]=1P2((Y[P]Y[0])+(Y[P+1]Y[1])++(Y[2P1]Y[P1])).\begin{aligned} S[P-1] &= \cfrac{1}{P}\sum _{i=0} ^{P-1} Y[i] \quad , \\ b[P-1] &= \cfrac{1}{P^2} \left((Y[P]-Y[0]) + (Y[P+1]-Y[1]) + \cdots + (Y[2P-1]-Y[P-1])\right) \quad . \end{aligned}

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.

See Also: StatTimeSerAnalysis::TripleExpForecast
Declared in Dew::Stats::Units::StatTimeSerAnalysis · Dew.Stats/Units.StatTimeSerAnalysis.h · Cross-compiler

Overload 2: void TripleExpSmooth(TVec *Y, TVec *S, TVec *B, TVec *L, const double Alpha, const double Beta, const double Gamma, double &MSE, const int Period);

In this case a fixed smoothing constants Alpha, Beta and Gamma are used in smoothing equations (no minimization is performed).

#NameTypeDescription
1YTVec *Time series data set.
2STVec *Smoothed values (see above equation). Size and complex properties of S are set automatically.
3BTVec *Trend values (see above equation). Size and complex properties of b are set automatically.
4LTVec *Seasonal indices (see above equation). Size and complex properties of L are set automatically.
5Alphaconst doubleDefines initial estimate for Alpha, returns Alpha which minimizes MSE.
6Betaconst doubleDefines initial estimate for Beta, returns Beta which minimizes MSE.
7Gammaconst doubleDefines initial estimate for Gamma, returns Gamma which minimizes MSE.
8MSEdouble &Returns MSE, evaluated for constant Alpha, Beta and Gamma.
9Periodconst intPeriod length. An exception is raised if Y.Length mod Period is not 0.
Declared in Dew::Stats::Units::StatTimeSerAnalysis · Dew.Stats/Units.StatTimeSerAnalysis.h · Cross-compiler