Residuals: Array;
Свойство Residuals возвращает ряд остатков.
Sub Main;
Var
MS: SmMedianSmoothing;
s, ar: Array Of Double;
d: Double;
res, i: Integer;
Begin
s := New Double[10];
s[0] := 6;
s[1] := 5;
s[2] := 7;
s[3] := 28;
s[4] := 1;
s[5] := 10;
s[6] := 9;
s[7] := 10;
s[8] := 4;
s[9] := 8;
MS := New SmMedianSmoothing.Create;
MS.Serie.Value := s;
MS.ModelPeriod.FirstPoint := 1;
MS.ModelPeriod.LastPoint := 10;
MS.MissingData.Method := MissingDataMethod.Casewise;
MS.Width := 2;
res := MS.Execute;
If res <> 0 Then
Debug.WriteLine(MS.Errors);
Else
Debug.WriteLine("== Остатки ==");
ar := MS.Residuals;
For i := 0 To Ms.ModelPeriod.LastPoint - 1 Do
d := ar[i];
Debug.WriteLine(i.ToString + ", " + d.ToString);
End For;
End If;
End Sub Main;
После выполнения примера в окно консоли будет выведен ряд остатков:
Module execution started
== Остатки ==
0, 0.5
1, -1
2, -10.5
3, 13.5
4, -4.5
5, 0.5
6, -0.5
7, 3
8, -2
9, 1.#QNAN
Module execution finished
См. также: