Cycle: Integer;
The Cycle property determines seasonality period. For example, 4 quarters or 12 months.
Default property value is 0.
Sub Main;
Var
ARIMA: SmArima;
serie: Array Of Double;
Specification: IArimaSpecification;
res, i: Integer;
d0: Double;
Begin
ARIMA := New SmArima.Create;
serie := New Double[26];
serie[0] := 0;
serie[1] := 0;
serie[2] := 0.878471616;
serie[3] := 0.85401205;
serie[4] := 3.785177462;
serie[5] := 1.28083579;
serie[6] := 5.345764494;
serie[7] := 4.237308214;
serie[8] := 4.864879297;
serie[9] := 7.765499027;
serie[10] := 3.548892753;
serie[11] := 5.142962432;
serie[12] := 2.512417383;
serie[13] := 3.382746302;
serie[14] := 4.457015799;
serie[15] := 5.560026451;
serie[16] := 5.402062371;
serie[17] := 6.384467741;
serie[18] := 4.464268156;
serie[19] := 5.803763577;
serie[20] := 3.60729744;
serie[21] := 3.741717667;
serie[22] := 2.958338923;
serie[23] := 2.261327116;
serie[24] := 3.549542062;
serie[25] := 1.829321841;
ARIMA.Serie.Value := serie;
ARIMA.Forecast.LastPoint := 40;
Specification := ARIMA.ArimaSpecification;
Specification.AutoRegressionOrder := 0;
Specification.MovingAverageOrder := 1;
Specification.Cycle := 4;
Specification.SeasonalAutoRegressionOrder := 1;
Specification.SeasonalMovingAverageOrder := 1;
ARIMA.ModelCoefficients.Intercept.Mode := InterceptMode.AutoEstimate;
ARIMA.MaxIteration := 150;
res := ARIMA.Execute;
Debug.WriteLine(res); // display execution status
Debug.WriteLine("=== Modeling series === "); // display data series in the console window
For i := 0 To ARIMA.Fitted.Length - 1 Do
d0 := ARIMA.Fitted[i];
Debug.WriteLine(i.ToString + ", " + d0.ToString);
End For;
End Sub Main;
After executing the example the following result is displayed in the console window:
Module execution started
0
=== Modeling series ===
0, 1.#QNAN
1, 1.#QNAN
2, 1.#QNAN
3, 1.#QNAN
4, 5.9484639363573155
5, 3.0790426231248382
6, 7.8285534594862307
7, 4.2466745153907128
8, 8.3025489580776544
9, 6.2218711120161201
10, 5.0227710957719989
11, 4.3279288845355719
12, 0.94751642913029199
13, 4.1657435496398953
14, 4.1562081944259166
15, 7.0076496846285838
16, 5.5696361654711879
17, 5.9008622933262176
18, 3.3785194186121905
19, 5.2059201293409805
20, 1.5114410515019778
21, 3.500017874448889
22, 0.64456711306434
23, 2.9481949257942133
24, 2.4126957860077867
25, 2.4758635056544551
Module execution finished
See also: