Stats Master VCL
|
First estimate Alpha and Gamma parameters by double smoothing and then use returned values to forecast up to T periods.
Parameters |
Description |
Y |
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. |
T |
Forecast values up to T period. |
MSE |
MSE, evaluated at minimum. |
InitMethod |
Defines how the initial values for b[0] are calculated. |
Use this routine if you don't know the best estimates for Alpha and Gamma.
Do estimation and forecasting in single routine call.
Uses MtxExpr, StatTimeSerAnalysis, Math387; procedure Example; var Data,YHat: Vector; Alpha,Gamma: double; 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 "MtxExpr.hpp" #include "Math387.hpp" #include "StatTimeSerAnalysis.hpp" void __fastcall Example(); { sVector 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) }
Copyright (c) 1999-2024 by Dew Research. All rights reserved.
|
What do you think about this topic? Send feedback!
|