Dew Stats Master .NET
DoubleExpForecast Routines
Summary
Double exponential forecast.

Unit
StatTimeSerAnalysis

Declaration
Procedure DoubleExpForecast(Y: TVec; YHat: TVec; const Alpha, Gamma: TSample; T: Integer; InitMethod: Integer = 0);
 Parameter  Description 
Time series data set. 
YHat Time series forecasts. Size of the YHat vector are adjusted automatically. 
Alpha Overal smoothing parameter used for forecast. 
Gamma Trend smoothing parameter used for forecast. 
Forecast values up to T period. 
InitMethod Defines how the initial values for b[0] are calculated. 

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

Categories
Time series analysis routines
 See Also 
DoubleExpSmooth 

Declaration
Procedure DoubleExpForecast(Y: TVec; YHat: TVec; var Alpha, Gamma: TSample; T: Integer; out MSE: TSample; InitMethod: Integer = 0);
 Parameter  Description 
MSE MSE, evaluated at minimum. 

Description
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) } }

Copyright 2008 Dew Research
http://www.dewresearch.com