StatTimeSerAnalysis::ARMALogLike Function

double ARMALogLike(TVec *Data, TVec *Trend, TVec *Phi, TVec *Theta, TVec *Residuals);

-2log likelihood.

#NameTypeDescription
1DataTVec *Input date.
2TrendTVec *Optional trend line. Can be nil, if constant (average value) is assumed.
3PhiTVec *stores phi[0]..phi[p-1] coefficients. The order of AR(p) is defined by Phi vector length.
4ThetaTVec *stores theta[0]..theta[q-1] coefficients. The order of AR(p) is defined by Phi vector length.
5ResidualsTVec *stores the "errors" left after the fitting process.

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

Examples
#include "MtxExpr.h"
#include "Units.StatTimeSerAnalysis.h"

using namespace Dew;
using namespace Dew::Math;
using namespace Dew::Stats;
using namespace Dew::Stats::Units::StatTimeSerAnalysis;

void Example()
{
    Vector phi(0);
    Vector theta(0);
    Vector ts(0);
    Vector residuals(0);
    ts.Size(100);
    ts.RandGauss();
    phi.SetIt(false, DewArray<double>{0.33,-0.24});
    theta.SetIt(false,DewArray<double>{0.9});
    // ARMA(2,1) process -> evaluate -2log likelihood
    double l = ARMALogLike(ts,nullptr,phi,theta,residuals);
}
Declared in Dew::Stats::Units::StatTimeSerAnalysis · Dew.Stats/Units.StatTimeSerAnalysis.h · Cross-compiler