Overload List
| # | Signature | Description |
|---|---|---|
| 1 | void DoubleExpForecast(TVec *Y, TVec *YHat, const double Alpha, const double Gamma, const int T, const int InitMethod = 0); | Double exponential forecast. |
| 2 | void DoubleExpForecast(TVec *Y, TVec *YHat, double &Alpha, double &Gamma, const int T, double &MSE, const int InitMethod = 0); | 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, const double Alpha, const double Gamma, const int T, const int InitMethod = 0);
Double exponential forecast.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Y | TVec * | Time series data set. |
| 2 | YHat | TVec * | Time series forecasts. Size of the YHat vector are adjusted automatically. |
| 3 | Alpha | const double | Overal smoothing parameter used for forecast. |
| 4 | Gamma | const double | Trend smoothing parameter used for forecast. |
| 5 | T | const int | Forecast values up to T period. |
| 6 | InitMethod = 0 | const int | Defines how the initial values for b[0] are calculated. |
Remarks:
Forecasts time series values by using double exponential smoothing equations. For double exponential smoothing, the h period ahead forecast is given by:
Examples
#include "MtxExpr.h"
#include "Units.StatTimeSerAnalysis.h"
using namespace Dew;
using namespace Dew::Math;
using namespace Dew::Stats;
using namespace Dew::Stats::Units::StatTimeSerAnalysis;
void Example()
{
Vector Data, YHat;
double Alpha, Gamma;
int T, NumPoints;
double MSE;
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)
}
See Also: StatTimeSerAnalysis::DoubleExpSmooth
Declared in Dew::Stats::Units::StatTimeSerAnalysis · Dew.Stats/Units.StatTimeSerAnalysis.h · Cross-compiler
Overload 2: void DoubleExpForecast(TVec *Y, TVec *YHat, double &Alpha, double &Gamma, const int T, double &MSE, const int InitMethod = 0);
First estimate Alpha and Gamma parameters by double smoothing and then use returned values to forecast up to T periods.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Y | TVec * | Time series data set. |
| 2 | YHat | TVec * | Time series forecasts. Size of the YHat vector are adjusted automatically. |
| 3 | Alpha | double & | Overal smoothing parameter used for forecast. |
| 4 | Gamma | double & | Trend smoothing parameter used for forecast. |
| 5 | T | const int | Forecast values up to T period. |
| 6 | MSE | double & | MSE, evaluated at minimum. |
| 7 | InitMethod = 0 | const int | Defines how the initial values for b[0] are calculated. |
Remarks:
Use this routine if you don't know the best estimates for Alpha and Gamma.
Examples
#include "MtxExpr.h"
#include "Units.StatTimeSerAnalysis.h"
using namespace Dew;
using namespace Dew::Math;
using namespace Dew::Stats;
using namespace Dew::Stats::Units::StatTimeSerAnalysis;
void Example()
{
Vector Data(0);
Vector YHat(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;
DoubleExpForecast(Data,YHat,alpha,gamma,T,MSE,1);
// returs MSE and estimated Alpha (from MLE)
}
Declared in Dew::Stats::Units::StatTimeSerAnalysis · Dew.Stats/Units.StatTimeSerAnalysis.h · Cross-compiler