double ARMALogLike(TVec *Data, TVec *Trend, TVec *Phi, TVec *Theta, TVec *Residuals);
-2log likelihood.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Data | TVec * | Input date. |
| 2 | Trend | TVec * | Optional trend line. Can be nil, if constant (average value) is assumed. |
| 3 | Phi | TVec * | stores phi[0]..phi[p-1] coefficients. The order of AR(p) is defined by Phi vector length. |
| 4 | Theta | TVec * | stores theta[0]..theta[q-1] coefficients. The order of AR(p) is defined by Phi vector length. |
| 5 | Residuals | TVec * | 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