MissingData: IMissingData;
MissingData: Prognoz.Platform.Interop.Stat.SlMissingData;
Свойство MissingData определяет метод обработки пропусков.
По умолчанию обработка пропусков не выполняется.
Добавьте ссылку на системную сборку Stat.
Sub UserProc;
Var
GrangerCT: ISmGrangerTest;
y: Array[10,4] Of Double;
res, i, j: Integer;
ResValue: Array Of Integer;
PValue, TStat: Array Of Double;
Begin
GrangerCT := New SmGrangerTest.Create;
// значения Y
y[0, 0] := 6209; y[0, 1] := 4110; y[0, 2] := 3415; y[0, 3] := 2822;
y[1, 0] := 6385; y[1, 1] := 4280; y[1, 2] := 3673; y[1, 3] := 3023;
y[2, 0] := 6752; y[2, 1] := 4459; y[2, 2] := 4013; y[2, 3] := 3131;
y[3, 0] := 6837; y[3, 1] := 4545; y[3, 2] := 4278; y[3, 3] := 3351;
y[4, 0] := 6495; y[4, 1] := 4664; y[4, 2] := 4577; y[4, 3] := 3463;
y[5, 0] := 6907; y[5, 1] := 4861; y[5, 2] := 5135; y[5, 3] := Double.Nan;
y[6, 0] := 7349; y[6, 1] := 5195; y[6, 2] := 5388; y[6, 3] := 3815;
y[7, 0] := 7213; y[7, 1] := 5389; y[7, 2] := 5610; y[7, 3] := 3960;
y[8, 0] := 7061; y[8, 1] := 5463; y[8, 2] := 5787; y[8, 3] := 4119;
y[9, 0] := 7180; y[9, 1] := 5610; y[9, 2] := 6181; y[9, 3] := 4351;
GrangerCT.Data := y;
GrangerCT.Lag := 1;
GrangerCT.ConfidenceLevel := 0.05;
GrangerCT.MissingData.Method := MissingDataMethod.SampleAverage;
GrangerCT.MissingData.MethodParameter := 1000;
res := GrangerCT.Execute;
Debug.WriteLine("Матрица вероятностей:");
Debug.Indent;
For i := 0 To GrangerCT.PValueMatrix.GetUpperBound(1) Do
For j := 0 To GrangerCT.PValueMatrix.GetUpperBound(2) Do
PValue := GrangerCT.PValueMatrix;
Debug.Write(PValue[i, j].ToString + ", ");
End For;
Debug.WriteLine(" ");
End For;
Debug.Unindent;
Debug.WriteLine("Матрица результатов:");
Debug.Indent;
For i := 0 To GrangerCT.ResValueMatrix.GetUpperBound(1) Do
For j := 0 To GrangerCT.ResValueMatrix.GetUpperBound(2) Do
ResValue := GrangerCT.ResValueMatrix;
Debug.Write(ResValue[i, j].ToString + ", ");
End For;
Debug.WriteLine(" ");
End For;
Debug.Unindent;
Debug.WriteLine("Матрица статистик Фишера:");
Debug.Indent;
For i := 0 To GrangerCT.TStatMatrix.GetUpperBound(1) Do
For j := 0 To GrangerCT.TStatMatrix.GetUpperBound(2) Do
TStat := GrangerCT.TStatMatrix;
Debug.Write(TStat[i, j].ToString + ", ");
End For;
Debug.WriteLine(" ");
End For;
Debug.Unindent;
End Sub UserProc;
После выполнения примера в окно консоли будут выведены матрицы вероятностей и результатов и статистик Фишера.
Необходимые требования и результат выполнения примера Fore.NET совпадают с примером Fore.
Imports Prognoz.Platform.Interop.Stat;
…
Public Shared Sub Main(Params: StartParams);
Var
GrangerCT: ISmGrangerTest;
y: Array[4,10] Of Double;
res, i, j: Integer;
PValue, ResValue, TStat: System.Array;
Begin
GrangerCT := New SmGrangerTest.Create();
// значения Y
y[0, 0] := 6209; y[1, 0] := 4110; y[2, 0] := 3415; y[3, 0] := 2822;
y[0, 1] := 6385; y[1, 1] := 4280; y[2, 1] := 3673; y[3, 1] := 3023;
y[0, 2] := 6752; y[1, 2] := 4459; y[2, 2] := 4013; y[3, 2] := 3131;
y[0, 3] := 6837; y[1, 3] := 4545; y[2, 3] := 4278; y[3, 3] := 3351;
y[0, 4] := 6495; y[1, 4] := 4664; y[2, 4] := 4577; y[3, 4] := 3463;
y[0, 5] := 6907; y[1, 5] := 4861; y[2, 5] := 5135; y[3, 5] := Double.Nan;
y[0, 6] := 7349; y[1, 6] := 5195; y[2, 6] := 5388; y[3, 6] := 3815;
y[0, 7] := 7213; y[1, 7] := 5389; y[2, 7] := 5610; y[3, 7] := 3960;
y[0, 8] := 7061; y[1, 8] := 5463; y[2, 8] := 5787; y[3, 8] := 4119;
y[0, 9] := 7180; y[1, 9] := 5610; y[2, 9] := 6181; y[3, 9] := 4351;
GrangerCT.Data := y;
GrangerCT.Lag := 1;
GrangerCT.ConfidenceLevel := 0.05;
GrangerCT.MissingData.Method := MissingDataMethod.mdmSampleAverage;
GrangerCT.MissingData.MethodParameter := 1000;
res := GrangerCT.Execute();
System.Diagnostics.Debug.WriteLine("Матрица вероятностей:");
System.Diagnostics.Debug.Indent();
PValue := GrangerCT.PValueMatrix;
For i := 0 To GrangerCT.PValueMatrix.GetUpperBound(1) Do
For j := 0 To GrangerCT.PValueMatrix.GetUpperBound(0) Do
System.Diagnostics.Debug.Write(PValue[j, i].ToString() + ", ");
End For;
System.Diagnostics.Debug.WriteLine(" ");
End For;
System.Diagnostics.Debug.Unindent();
System.Diagnostics.Debug.WriteLine("Матрица результатов:");
System.Diagnostics.Debug.Indent();
ResValue := GrangerCT.ResValueMatrix;
For i := 0 To GrangerCT.ResValueMatrix.GetUpperBound(1) Do
For j := 0 To GrangerCT.ResValueMatrix.GetUpperBound(0) Do
System.Diagnostics.Debug.Write(ResValue[j, i].ToString() + ", ");
End For;
System.Diagnostics.Debug.WriteLine(" ");
End For;
System.Diagnostics.Debug.Unindent();
System.Diagnostics.Debug.WriteLine("Матрица статистик Фишера:");
System.Diagnostics.Debug.Unindent();
For i := 0 To GrangerCT.TStatMatrix.GetUpperBound(1) Do
For j := 0 To GrangerCT.TStatMatrix.GetUpperBound(0) Do
TStat := GrangerCT.TStatMatrix;
System.Diagnostics.Debug.Write(TStat[j, i].ToString() + ", ");
End For;
System.Diagnostics.Debug.WriteLine(" ");
End For;
System.Diagnostics.Debug.Unindent();
End Sub;
См. также: