StatTimeSerAnalysis.ARMALogLike Method

function ARMALogLike(const Data: TVec; const Trend: TVec; const Phi: TVec; const Theta: TVec; const Residuals: TVec): Double;

-2log likelihood.

#NameDescription
1DataInput date.
2TrendOptional trend line. Can be nil, if constant (average value) is assumed.
3Phistores phi[0]..phi[p-1] coefficients. The order of AR(p) is defined by Phi vector length.
4Thetastores theta[0]..theta[q-1] coefficients. The order of AR(p) is defined by Phi vector length.
5Residualsstores the "errors" left after the fitting process.

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

Examples
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;