ISmCurveEstimation.ModelPeriod

Синтаксис

ModelPeriod: IStatPeriod;

Описание

Свойство ModelPeriod определяет параметры периода идентификации.

Пример

Sub Main;

Var

trend: SmCurveEstimation;

status: Integer;

ar: Array Of Double;

Period: IStatPeriod;

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], 0));

End If;

End For;

Debug.WriteLine("---End---");

End Sub Print;

Begin

trend := New SmCurveEstimation.Create;

ar := New Double[25];

ar[00] := 4110;

ar[01] := 4280;

ar[02] := 4459;

ar[03] := 4545;

ar[04] := 4664;

ar[05] := 4861;

ar[06] := 5195;

ar[07] := 5389;

ar[08] := 5463;

ar[09] := 5610;

ar[10] := 5948;

ar[11] := 6218;

ar[12] := 6521;

ar[13] := 6788;

ar[14] := 7222;

ar[15] := 7486;

ar[16] := 7832;

ar[17] := 8153;

ar[18] := 8468;

ar[19] := 9054;

ar[20] := 9499;

ar[21] := 9866;

ar[22] := 10217;

ar[23] := 10763;

ar[24] := 10683;

trend.Explained.Value := ar;

trend.Explanatory.IsTrend := True;

Period := trend.ModelPeriod;

Period.FirstPoint := 3;

Period.LastPoint := 20;

trend.ForecastLastPoint := 30;

trend.SeasonalComponent.Mode := SeasonalityType.additive;

trend.SeasonalComponent.Cycle := 4;

status := trend.Execute;

If status <> 0 Then

Debug.WriteLine(trend.Errors);

Else

Debug.WriteLine("== Модельный ряд ==");

Print(trend.Explained.Value);

Debug.WriteLine("== Исходный ряд ==");

Print(trend.Explained.OriginalValue);

End If;

End Sub Main;

После выполнения примера в окно консоли будут выведены исходный и модельный ряды:

== Модельный ряд == == Исходный ряд ==

0: ---empty--- 4 110

1: ---empty--- 4 280

2: 4 427 4 459

3: 4 513 4 545

4: 4 687 4 664

5: 4 902 4 861

6: 5 163 5 195

7: 5 357 5 389

8: 5 486 5 463

9: 5 651 5 610

10: 5 916 5 948

11: 6 186 6 218

12: 6 544 6 521

13: 6 829 6 788

14: 7 190 7 222

15: 7 454 7 486

16: 7 855 7 832

17: 8 194 8 153

18: 8 436 8 468

19: 9 022 9 054

20: ---empty--- 9 499

21: ---empty--- 9 866

22: ---empty--- 10 217

23: ---empty--- 10 763

24: ---empty--- 10 683

См. также:

ISmCurveEstimation