Irregula: Array;
Свойство Irregula возвращает нерегулярную компоненту.
Sub Main;
Var
s: Array Of Double;
census1: SmCensus1;
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
s := New Double[45];
s[0] := 670.2000183;
s[1] := 576.0680563;
s[2] := 717.6484268;
s[3] := 856.9105808;
s[4] := 885.4609516;
s[5] := 1011.846431;
s[6] := 995.4496292;
s[7] := 1064.74221;
s[8] := 1033.324656;
s[9] := 780.8584552;
s[10] := 657.5033113;
s[11] := 654.5472579;
s[12] := 678.2380139;
s[13] := 642.4128544;
s[14] := 751.9611194;
s[15] := 786.7090365;
s[16] := 884.5042879;
s[17] := 1008.308908;
s[18] := 1108.363628;
s[19] := 1072.737175;
s[20] := 1019.183752;
s[21] := 895.5601672;
s[22] := 811.0306101;
s[23] := 756.601764;
s[24] := 826.6160466;
s[25] := 762.3903317;
s[26] := 931.5707266;
s[27] := 1026.666524;
s[28] := 1114.124119;
s[29] := 1099.626392;
s[30] := 1189.16892;
s[31] := 1092.343791;
s[32] := 1087.503861;
s[33] := 971.6522721;
s[34] := 826.2502823;
s[35] := 789.6322825;
s[36] := 797.0210578;
s[37] := 770.0206;
s[38] := 832.1481674;
s[39] := 1014.565844;
s[40] := 980.4343089;
s[41] := 1195.843135;
s[42] := 1117.405835;
s[43] := 1142.834834;
s[44] := 1239.704489;
census1 := New SmCensus1.Create;
census1.Serie.Value := s;
census1.ModelPeriod.FirstPoint := 1;
census1.ModelPeriod.LastPoint := 45;
census1.SeasonalComponent.Mode := SeasonalityType.Multiplicative;
census1.CenterMovingAverage := True;
census1.SeasonalComponent.Cycle := 12;
res := census1.Execute;
If res<>0 Then
Debug.WriteLine(census1.Errors);
Else
Debug.WriteLine("=== Нерегулярная компонента ===");
Print(census1.Irregula);
End If;
End Sub Main;
После выполнения примера в окно консоли будет выведена нерегулярная компонента:
Module execution started
=== Нерегулярная компонента ===
---Begin---
0, 1.0525
1, 0.9331
2, 1.0013
3, 1.0444
4, 0.9697
5, 1.0387
6, 0.9552
7, 1.0179
8, 1.0689
9, 0.9652
10, 0.9475
11, 1.0215
12, 1.0052
13, 0.9910
14, 1.0277
15, 0.9661
16, 0.9710
17, 1.0204
18, 1.0273
19, 0.9882
20, 0.9920
21, 0.9974
22, 1.0039
23, 0.9931
24, 1.0198
25, 0.9680
26, 1.0254
27, 1.0157
28, 1.0153
29, 0.9801
30, 1.0177
31, 0.9520
32, 1.0028
33, 1.0266
34, 0.9858
35, 1.0157
36, 0.9943
37, 1.0041
38, 0.9687
39, 1.0509
40, 0.9341
41, 1.0759
42, 0.9468
43, 0.9586
44, 1.1010
---End---
Module execution finished
См. также: