You are here: Symbol Reference > StatTimeSerAnalysis Namespace > Functions > StatTimeSerAnalysis.DoubleExpForecast Function
Stats Master VCL
ContentsIndex
Example

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-2025 by Dew Research. All rights reserved.