StatTimeSerAnalysis.DoubleExpForecast Method

Overload List

#SignatureDescription
1void DoubleExpForecast(TVec Y, TVec YHat, Double Alpha, Double Gamma, Int32 T, Int32 InitMethod)Double exponential forecast.
2void DoubleExpForecast(TVec Y, TVec YHat, ref Double Alpha, ref Double Gamma, Int32 T, ref Double MSE, Int32 InitMethod)First estimate Alpha and Gamma parameters by double smoothing and then use returned values to forecast up to T periods.

Overload 1: void DoubleExpForecast(TVec Y, TVec YHat, Double Alpha, Double Gamma, Int32 T, Int32 InitMethod)

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 .
See Also: StatTimeSerAnalysis.DoubleExpSmooth

Overload 2: void DoubleExpForecast(TVec Y, TVec YHat, ref Double Alpha, ref Double Gamma, Int32 T, ref Double MSE, Int32 InitMethod)

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.

Examples
using Dew.Math;
using Dew.Stats;
using Dew.Stats.Units;
namespace Dew.Examples
{
    private void Example()
    {
        Vector Data = new Vector(0);
        Vector YHat = new Vector(0);
        int NumPoints = 20;
        Data.LoadFromFile("aerosol_particles.vec");
        // last point period = Data.Length-1 + NumPoints
        int T = Data.Length-1+NumPoints;
        // initial estimates for alpha, gamma
        double alpha = 0.1;
        double gamma = 0.1;
        double MSE;
        StatTimeSerAnalysis.DoubleExpForecast(Data,YHat,ref alpha,ref gamma,T,out MSE,1);
        // returs MSE and estimated Alpha (from MLE)
    }
}