MissingData: IMissingData;
The MissingData property determines missing data treatment method.
By default missing data is not treated.
Add a link to the Stat system assembly.
Sub UserProc;
Var
Jtest: SmJohansenTest;
Dl, Rl, D: Array[17] Of Double;
ARO: Array[1] Of Integer;
Eqs: IJohansenTestEquations;
Eq: IJohansenTestEquation;
i, j, res: Integer;
d0, d1, d2, d3: Double;
CEV: Array Of Double;
Begin
Jtest := New SmJohansenTest.Create;
//values Dl, Rl, D
Dl[00] := -9999.99; Rl[00] := -9999.99; D[00] := -9999.99;
Dl[01] := -0.011060947; Rl[01] := -9999.99; D[01] := -9999.99;
Dl[02] := 0.088021988; Rl[02] := -9999.99; D[02] := -9999.99;
Dl[03] := Double.Nan; Rl[03] := -9999.99; D[03] := -9999.99;
Dl[04] := -0.174221365; Rl[04] := 0.104287003; D[04] := -9999.99;
Dl[05] := 0.027131344; Rl[05] := 0.026467205; D[05] := -0.01;
Dl[06] := 0.054179916; Rl[06] := 0.047706589; D[06] := 0.25;
Dl[07] := Double.Nan; Rl[07] := 0.01704113; D[07] := 0.13;
Dl[08] := -0.092249734; Rl[08] := -0.105077669; D[08] := 0.02;
Dl[09] := -0.006322466; Rl[09] := -0.110288178; D[09] := -0.01;
Dl[10] := 0.027113235; Rl[10] := -0.011793876; D[10] := -0.06;
Dl[11] := 0.057958277; Rl[11] := 0.031454854; D[11] := 0.04;
Dl[12] := -0.048741622; Rl[12] := -0.032034153; D[12] := 0.05;
Dl[13] := -0.00306279; Rl[13] := -0.053657954; D[13] := -0.01;
Dl[14] := 0.03120535; Rl[14] := -0.025958191; D[14] := 0.015;
Dl[15] := 0.104368944; Rl[15] := 0.074380868; D[15] := 0.025;
Dl[16] := -0.135574294; Rl[16] := -0.064428893; D[16] := 0.02;
ARO[0] := 1;
Eqs := Jtest.Equations;
Eq := Eqs.Add;
Eq.Serie.Value := Dl;
Eq.AutoRegressionOrder := ARO;
Eq := Eqs.Add;
Eq.Serie.Value := Rl;
Eq.AutoRegressionOrder := ARO;
Eq := Eqs.Add;
Eq.Serie.Value := D;
Eq.AutoRegressionOrder := ARO;
// Sample period:
Jtest.ModelPeriod.FirstPoint := 1;
Jtest.ModelPeriod.LastPoint := 17;
// Missing data treatment:
Jtest.MissingData.Method := MissingDataMethod.LinTrend;
// Error correction model type:
Jtest.ModelType := ECMType.NoTrendNoIntercept;
// Calculate model:
res := Jtest.Execute;
If res <> 0 Then
Debug.WriteLine(Jtest.Errors);
Else
Debug.WriteLine("Own value LikelihoodRatio 5% critical value 1% critical value");
For i := 0 To Jtest.Equations.Count-1 Do
Eq := Jtest.Equations.Item(i);
Debug.Write("Relations " + i.ToString + ": ");
d0 := Eq.Report.EigenValue;
d1 := Eq.Report.LikelihoodRatio;
d2 := Eq.Report.OnePercentCriticalValue;
d3 := Eq.Report.FivePercentCriticalValue;
Debug.WriteLine(" " + d0.ToString + ", " + d1.ToString + ", " + d2.ToString +", " + d3.ToString );
End For;
Debug.WriteLine("Cointegration equations");
For i := 0 To Jtest.CointegralEquations.Count - 1 Do
CEV := Jtest.CointegralEquations.Item(i).Value;
Debug.WriteLine("== Equation: " + (i + 1).ToString + " ==");
For j := 0 To CEV.Length - 1 Do
d0 := CEV[j];
Debug.WriteLine('(' + i.ToString + ", " + j.ToString + "): " + d0.ToString);
End For;
End For;
End If;
End Sub UserProc;
After executing the example the console window displays calculation results for the test, and cointegration equations.
See also: