SeasonalAutoRegression: Array;
The SeasonalAutoRegression property determines initial values for seasonal autoregression coefficients.
The number of coefficients depends on value of the SeasonalAutoRegression property.
Default initial values of the coefficients are equal to 0.
Sub Main;
Var
ARIMA: SmArima;
d0: Double;
res, i: Integer;
can, InitialValuesAR: Array Of Double;
InitValues: IArimaSpecificationInitialValues;
Begin
ARIMA := New SmArima.Create;
can := New Double[25];
can[00] := 6209;
can[01] := 6385;
can[02] := 6752;
can[03] := 6837;
can[04] := 6495;
can[05] := 6907;
can[06] := 7349;
can[07] := 7213;
can[08] := 7061;
can[09] := 7180;
can[10] := 7132;
can[11] := 7137;
can[12] := 7473;
can[13] := 7722;
can[14] := 8088;
can[15] := 8516;
can[16] := 8941;
can[17] := 9064;
can[18] := 9380;
can[19] := 9746;
can[20] := 9907;
can[21] := 10333;
can[22] := 10863;
can[23] := 11693;
can[24] := 12242;
ARIMA.Serie.Value := can;
ARIMA.ArimaSpecification.AutoRegressionOrder := 2;
ARIMA.ArimaSpecification.Cycle := 4;
ARIMA.ArimaSpecification.SeasonalAutoRegressionOrder := 2;
ARIMA.ArimaSpecification.SeasonalDifferenceOrder := 1;
ARIMA.ModelCoefficients.Intercept.Mode := InterceptMode.AutoEstimate;
ARIMA.Forecast.ConfidenceLevel := 0.95;
ARIMA.Forecast.LastPoint := 50;
ARIMA.MaxIteration := 1000;
InitialValuesAR := New Double[2];
InitialValuesAR[0] := 0.1;
InitialValuesAR[1] := 0.1;
InitValues := ARIMA.InitialValueS;
InitValues.SeasonalAutoRegression := InitialValuesAR;
res := ARIMA.Execute;
Debug.WriteLine(res.ToString);
Debug.WriteLine("==== Forecast ====");
For i := ARIMA.ModelPeriod.LastPoint To ARIMA.Forecast.Value.GetUpperBound(1) Do
d0 := ARIMA.Forecast.Value[i];
Debug.WriteLine(i.ToString + ", " + d0.ToString);
End For;
End Sub Main;
After executing the example the console window displays forecast values:
Module execution started
0
==== Forecast ====
25, 12461.295060215374
26, 12882.040903757348
27, 13513.518629381062
28, 13890.397381442001
29, 14116.364326812778
30, 14523.037899677071
31, 15181.198724214963
32, 15578.013669370077
33, 15741.597073168074
34, 16101.339926820443
35, 16699.263650484147
36, 17042.210752710278
37, 17186.933654503962
38, 17525.062393404995
39, 18109.685872649796
40, 18439.411464055895
41, 18558.594105435335
42, 18874.741395529105
43, 19436.114074493082
44, 19744.577954884691
45, 19849.388543078912
46, 20151.45851758877
47, 20700.89927279764
48, 20998.121858016722
49, 21090.243208900811
Module execution finished
See also: