AutoRegression: Array;
The AutoRegression property determines initial values for autoregression coefficients.
The number of coefficients depends on value of the AutoRegressionOrder 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.MovingAverageOrder := 1;
ARIMA.ArimaSpecification.DifferenceOrder := 1;
ARIMA.ModelCoefficients.Intercept.Mode := InterceptMode.AutoEstimate;
ARIMA.Forecast.ConfidenceLevel := 0.95;
ARIMA.Forecast.LastPoint := 50;
ARIMA.MaxIteration := 500;
InitialValuesAR := New Double[2];
InitialValuesAR[0] := 0.1;
InitialValuesAR[1] := 0.1;
InitValues := ARIMA.InitialValueS;
InitValues.AutoRegression := InitialValuesAR;
res := ARIMA.Execute; // method execution status
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, 12429.078161160662
26, 12700.718533112133
27, 12944.344208228997
28, 13196.711406356178
29, 13446.32609651364
30, 13696.806272924936
31, 13947.014250754028
32, 14197.307833166626
33, 14447.574493387032
34, 14697.849620488827
35, 14948.122084802661
36, 15198.395386548751
37, 15448.668424926975
38, 15698.941546132952
39, 15949.214641290053
40, 16199.487744639384
41, 16449.760845412304
42, 16700.033946995489
43, 16950.307048323852
44, 17200.580149732355
45, 17450.853251115655
46, 17701.126352506883
47, 17951.399453895614
48, 18201.672555285131
49, 18451.945656674401
Module execution finished
See also: