Overload List
| # | Signature | Description |
|---|---|---|
| 1 | void DoubleExpForecast(TVec Y, TVec YHat, Double Alpha, Double Gamma, Int32 T, Int32 InitMethod) | Double exponential forecast. |
| 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. |
Overload 1: void DoubleExpForecast(TVec Y, TVec YHat, Double Alpha, Double Gamma, Int32 T, Int32 InitMethod)
Double exponential forecast.
| # | Name | Description |
|---|---|---|
| 1 | Y | Time series data set. |
| 2 | YHat | Time series forecasts. Size of the YHat vector are adjusted automatically. |
| 3 | Alpha | Overal smoothing parameter used for forecast. |
| 4 | Gamma | Trend smoothing parameter used for forecast. |
| 5 | T | Forecast values up to T period. |
| 6 | InitMethod | Defines 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:
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.
| # | Name | Description |
|---|---|---|
| 1 | Y | Time series data set. |
| 2 | MSE | MSE, evaluated at minimum. |
| 3 | YHat | Time series forecasts. Size of the YHat vector are adjusted automatically. |
| 4 | Alpha | Overal smoothing parameter used for forecast. |
| 5 | Gamma | Trend smoothing parameter used for forecast. |
| 6 | T | Forecast values up to T period. |
| 7 | InitMethod | Defines 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)
}
}