CriticalValues: Array;
The CriticalValues property returns critical values for Dickey-Fuller statistics for the three significance levels: 0.01, 0.05 and 0.1.
The property is outdated. Use ISmAugmentDickeyFullerTest.ADFStat.
Sub Main;
Var
ADF: SmAugmentDickeyFullerTest;
res: Integer;
can, y: Array Of Double;
Sub Print(Data: Array Of Double);
Var
i: Integer;
CI: ICultureInfo;
Begin
CI := CultureInfo.Current;
Debug.WriteLine("---Begin---");
For i := 0 To Data.Length - 1 Do
If Double.IsNan(Data[i]) Then
Debug.WriteLine("---empty---");
Else
Debug.WriteLine(i.ToString + ", " + CI.FormatDoublePrec(Data[i], 4));
End If;
End For;
Debug.WriteLine("---End---");
End Sub Print;
Begin
ADF := New SmAugmentDickeyFullerTest.Create;
can := New Double[16];
//values can
can[00] := 6209;
can[01] := 6385;
can[02] := 6752;
can[03] := 6837;
can[04] := 6495;
can[05] := 6907;
can[06] := 7349;
can[07] := 7213;
can[08] := 7061;
can[09] := 7180;
can[10] := 7132;
can[11] := 7137;
can[12] := 7473;
can[13] := 7722;
can[14] := 8088;
can[15] := 8516;
ADF.Serie.Value := can;
ADF.ModelPeriod.FirstPoint := 1;
ADF.ModelPeriod.LastPoint := 16;
ADF.EquationType := ADFEquationType.ConstantTrend;
ADF.TestedSeries := ADFTestedSeriesType.Level;
ADF.AutoRegressionOrder := 2;
res := ADF.Execute;
If res <> 0 Then
Debug.WriteLine(ADF.Errors);
Else
Debug.WriteLine("== Critical values ==");
Print(ADF.CriticalValues);
Debug.WriteLine("== Model coefficients ==");
y := ADF.ModelCoefficients.Estimate;
Print(y);
End If;
End Sub Main;
After executing the example the console window displays results of test calculation:
Module execution started
== Critical values ==
---Begin---
0, -4.5348
1, -3.6746
2, -3.2762
---End---
== Model coefficients ==
---Begin---
0, -0.1985
1, 0.1815
2, -0.3807
---End---
Module execution finished
See also: