StatTimeSerAnalysis.DoubleExpForecast Method

Overload List

#SignatureDescription
1procedure DoubleExpForecast(const Y: TVec; const YHat: TVec; const Alpha: Double; const Gamma: Double; const T: Integer; const InitMethod: Integer);Double exponential forecast.
2procedure DoubleExpForecast(const Y: TVec; const YHat: TVec; var Alpha: Double; var Gamma: Double; const T: Integer; out MSE: Double; const InitMethod: Integer);First estimate Alpha and Gamma parameters by double smoothing and then use returned values to forecast up to T periods.

Overload 1: procedure DoubleExpForecast(const Y: TVec; const YHat: TVec; const Alpha: Double; const Gamma: Double; const T: Integer; const InitMethod: Integer);

Double exponential forecast.

#NameDescription
1YTime series data set.
2YHatTime series forecasts. Size of the YHat vector are adjusted automatically.
3AlphaOveral smoothing parameter used for forecast.
4GammaTrend smoothing parameter used for forecast.
5TForecast values up to T period.
6InitMethodDefines how the initial values for b[0] are calculated.

Result: stored in self (calling object)

Remarks:

Forecasts time series values by using double exponential smoothing equations. For double exponential smoothing, the h period ahead forecast is given by:

F[t+h]=S[t]+hb[t].F[t+h] = S[t]+h\cdot b[t] \quad .
Examples
Uses MtxExpr, StatTimeSerAnalysis, Math387;
procedure Example;
var Data,YHat: Vector;
Alpha,Gamma: double;
T, NumPoints: Integer;
begin
    NumPoints := 20;
    Data.LoadFromFile('aerosol_particles.vec');
    // last point period = Data.Length-1 + NumPoints
    T := Data.Length-1+NumPoints;
    // initial estimates for Alpha, Gamma
    Alpha := 0.1;
    Gamma := 0.1;
    DoubleExpForecast(Data,YHat,Alpha,Gamma,T,MSE,1);
    // returs MSE and estimated Alpha (from MLE)
end;
See Also: StatTimeSerAnalysis.DoubleExpSmooth

Overload 2: procedure DoubleExpForecast(const Y: TVec; const YHat: TVec; var Alpha: Double; var Gamma: Double; const T: Integer; out MSE: Double; const InitMethod: Integer);

First estimate Alpha and Gamma parameters by double smoothing and then use returned values to forecast up to T periods.

#NameDescription
1YTime series data set.
2MSEMSE, evaluated at minimum.
3YHatTime series forecasts. Size of the YHat vector are adjusted automatically.
4AlphaOveral smoothing parameter used for forecast.
5GammaTrend smoothing parameter used for forecast.
6TForecast values up to T period.
7InitMethodDefines how the initial values for b[0] are calculated.

Result: stored in self (calling object)

Remarks:

Use this routine if you don't know the best estimates for Alpha and Gamma.