Double exponential forecast.
Forecasts time series values by using double exponential smoothing equations. For double exponential smoothing, the h period ahead forecast is given by:
First estimate Alpha and Gamma parameters by double smoothing and then use returned values to forecast up to T periods. Use this routine if you don't know the best estimates for Alpha and Gamma.
Example 1
Do estimation and forecasting in single routine call. Uses MtxExpr, StatTimeSerAnalysis, Math387;
procedure Example;
var Data,YHat: Vector;
Alpha,Gamma: TSample;
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;
#include "MtxVecCpp.h"
#include "Math387.hpp"
#include "StatTimeSerAnalysis.hpp"
void __fastcall Example();
{
Vector Data,YHat;
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)
}
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)
}
}