Residuals: Array;
Свойство Residuals возвращает ряд остатков.
Sub Main;
Var
GExtra: SmGeometricExtrapolation;
s: Array Of Double;
res: Integer;
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
s := New Double[15];
//значения s
s[00] := 6209;
s[01] := 6385;
s[02] := 6752;
s[03] := 6837;
s[04] := 6495;
s[05] := 6907;
s[06] := 7349;
s[07] := 7213;
s[08] := 7061;
s[09] := 7180;
s[10] := 7132;
s[11] := 7137;
s[12] := 7473;
s[13] := 7722;
s[14] := 8088;
GExtra := New SmGeometricExtrapolation.Create;
GExtra.Serie.Value := s;
GExtra.MissingData.Method := MissingDataMethod.Casewise;
GExtra.ModelPeriod.FirstPoint := 1;
GExtra.ModelPeriod.LastPoint := 14;
GExtra.Forecast.LastPoint := 20;
res := GExtra.Execute;
If res <> 0 Then
Debug.WriteLine(GExtra.Errors);
Else
Debug.WriteLine("Остатки");
Print(GExtra.Residuals);
End If;
End Sub Main;
После выполнения примера в окно консоли будет выведен ряд остатков.
Module execution started
Остатки
---Begin---
0, 0.0000
1, 67.3395
2, 323.7773
3, 296.2803
4, -160.1855
5, 135.3455
6, 458.8383
7, 202.2571
8, -72.4343
9, -78.2729
10, -253.2962
11, -377.5425
12, -173.0507
13, -57.8603
---End---
Module execution finished
См. также: