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

-2log likelihood.

Pascal
function ARMALogLike(const Data: TVec; const Trend: TVec; const Phi: TVec; const Theta: TVec; const Residuals: TVec): double;
Parameters 
Description 
Data 
Input date. 
Trend 
Optional trend line. Can be nil, if constant (average value) is assumed.  
Phi 
stores phi[0]..phi[p-1] coefficients. The order of AR(p) is defined by Phi vector length. 
Theta 
stores theta[0]..theta[q-1] coefficients. The order of AR(p) is defined by Phi vector length. 
Residuals 
stores the "errors" left after the fitting process. 

-2log likelihood for ARIMA(p,q,d) process.

Uses MtxExpr, StatTimeSerAnalysis, Math387;
procedure Example;
var phi,theta, ts: Vector;
    l: double;
begin
  ts.LoadFromFile('ts_data.vec');
  phi.SetIt(false,[0.33,-0.24]);
  theta.SetIt(false,[0.9]);
  // ARMA(2,1,2) process -> evaluate -2log likelihood
  l := ARMALogLike(ts,phi,theta);
end;
#include "MtxExpr.hpp"
#include "Math387.hpp"
#include "StatTimeSerAnalysis.hpp"
void __fastcall Example();
{
  sVector phi,theta,ts;
      ts.Size(100);
      ts.RandGauss();

      phi.SetIt(false,OPENARRAY(double,(0.33,-0.24)));
      theta.SetIt(false,OPENARRAY(double,(0.9)));
      // ARMA(2,1,2) process -> evaluate -2log likelihood
      double l = ARMALogLike(ts,phi,theta);
}
Examples on GitHub
Copyright (c) 1999-2025 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!