MissingData: IMissingData;
The MissingData property returns parameters of missing data treatment in the explained series.
By default missing data is not treated.
Add a link to the Stat system assembly.
Sub UserProc;
Var
CointegrEq: ISmCointegrationEq;
y: Array[11] Of Double;
x1: Array[21] Of Double;
AR_X, AR_Y: Array[1] Of Integer;
CommonEx, LongTerm: Array[1] Of Integer;
Res: Integer;
Eq: ISlEquation;
VARStat: IVARStatistics;
Begin
CointegrEq := New SmCointegrationEq.Create;
// Endogenous variable:
y[00] := 95; y[01] := 45; y[02] := Double.Nan;
y[03] := -36; y[04] := 10; y[05] := -15;
y[06] := 36; y[07] := -10; y[08] := Double.Nan;
y[09] := -44; y[10] := -7;
// Exogenous variable:
x1[00] := 6; x1[01] := 8; x1[02] := 10;
x1[03] := 5; x1[04] := 3; x1[05] := 6;
x1[06] := 3; x1[07] := 7; x1[08] := 8;
x1[09] := 10; x1[10] := 5; x1[11] := 2;
x1[12] := 1; x1[13] := 1; x1[14] := 3;
x1[15] := 4; x1[16] := 7; x1[17] := 4;
x1[18] := 7; x1[19] := 4; x1[20] := 3;
Eq := CointegrEq.Equation;
// Output series
Eq.Serie.Value := y;
// Exogenous variable:
Eq.ExogenousVariables.Add.Value := x1;
AR_Y[0] := 1;
AR_X[0] := 0;
// Autoregression order of endogenous variable:
CointegrEq.SerieAROrder := AR_Y;
//Autoregression order of exogenous variable:
Eq.AutoRegressionOrder := AR_X;
// Sample period:
CointegrEq.Period.FirstPoint := 0;
CointegrEq.Period.LastPoint := 11;
// Forecast:
Eq.Forecast.LastPoint := 21;
// Include the first exogenous variable into short-term links group
CommonEx[0] := 0;
CointegrEq.CommonExogenious := CommonEx;
// Include the second exogenous variable into long-term links group
LongTerm[0] := 0;
CointegrEq.LongTermExogenious := LongTerm;
// Missing data treatment:
CointegrEq.MissingData.Method := MissingDataMethod.LinTrend;
// Calculate model:
Res := CointegrEq.Execute;
If Res = 0 Then
Debug.WriteLine("=== Values of vector autoregression statistics ===");
VARStat := CointegrEq.VARStatistics;
Debug.WriteLine("Covariance matrix determinant:");
Debug.WriteLine(VARStat.RC);
Debug.WriteLine("Residuals covariance matrix determinant:");
Debug.WriteLine(VARStat.RCadj);
Debug.WriteLine("Log-likelihood function:");
Debug.WriteLine(VARStat.LLV);
Debug.WriteLine("Akaike information criterion:");
Debug.WriteLine(VARStat.AIC);
Debug.WriteLine("Schwarz criterion:");
Debug.WriteLine(VARStat.SC);
Else
Debug.Writeline(CointegrEq.Errors);
End If;
End Sub UserProc;
After executing the example the console window displays vector autoregression statistics values.
See also: