StatTimeSerAnalysis.SingleExpForecast Method

Overload List

#SignatureDescription
1procedure SingleExpForecast(const Y: TVec; const YHat: TVec; const Alpha: Double; const T: Integer; const InitMethod: Integer);Single exponential forecast.
2procedure SingleExpForecast(const Y: TVec; const YHat: TVec; var Alpha: Double; const T: Integer; out MSE: Double; const InitMethod: Integer);rst estimate Alpha parameters by single smoothing and then use returned value to forecast up to T periods.

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

Single exponential forecast.

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

Result: stored in self (calling object)

Remarks:

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

F[t+h]=S[t].F[t+h] = S[t] \quad .
Examples
Uses MtxExpr, StatTimeSerAnalysis, Math387;
procedure Example;
var Data,YHat: Vector;
T: Integer;
NumPoints: Integer;
Residuals: TVec;
begin
    NumPoints := 20;
    Data.LoadFromFile('aerosol_particles.vec');
    // last point period = Data.Length-1 + NumPoints
    T := Data.Length-1+NumPoints;
    SingleExpForecast(Data,YHat,0.33,T,0);
    // YHat now stores estimates for YHat[1,...Length-1]
    // so, if we need residuals, we have to subtract
    // these values from y[1,...,Length-1)
    Residuals.Size(YHat);
    Residuals.Sub(Y,YHat,1,0,0,YHat.Length);
end;
See Also: StatTimeSerAnalysis.SingleExpSmooth

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

rst estimate Alpha parameters by single smoothing and then use returned value to forecast up to T periods.

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

Result: stored in self (calling object)

Remarks:

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

Examples
Uses MtxExpr, StatTimeSerAnalysis, Math387;
procedure Example;
var Data,YHat: Vector;
Alpha: 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 Alpha estimate = 0.6
    Alpha := 0.6;
    SingleExpForecast(Data,YHat,Alpha,T,MSE,0);
    // returs MSE and estimated Alpha (from MLE)
end;