ISmGeometricExtrapolation.ModelPeriod

Синтаксис

ModelPeriod: IStatPeriod;

Описание

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

Пример

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.Fitted);

End If;

End Sub Main;

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

Module execution started

Сглаженный ряд

---Begin---

0, 6 209.0000

1, 6 317.6605

2, 6 428.2227

3, 6 540.7197

4, 6 655.1855

5, 6 771.6545

6, 6 890.1617

7, 7 010.7429

8, 7 133.4343

9, 7 258.2729

10, 7 385.2962

11, 7 514.5425

12, 7 646.0507

13, 7 779.8603

---End---

Module execution finished

См. также:

ISmGeometricExtrapolation