MovingAverageOrder: Integer;
The MovingAverageOrder property determines order of moving average.
Default property value is 1.
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 := 2;
Specification.DifferenceOrder := 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 console window displays the following result:
Module execution started
0
=== Modeling series ===
0, 1.#QNAN
1, -0.81345445933695093
2, 1.0170072508211325
3, -1.199938550685395
4, 5.9732468572703983
5, -0.44063083448549434
6, 4.1250370439086588
7, 5.245244597441153
8, 3.3445097339841561
9, 10.855204926655588
10, 3.8640171750295598
11, 4.7670127755144236
12, 1.3340551024523259
13, 2.6031337298448856
14, 4.4949959974908396
15, 6.5502875198295962
16, 4.5392526328434419
17, 7.2678708732490636
18, 4.1333881586403871
19, 7.1288819577652403
20, 3.9982167531280677
21, 3.2915378377546518
22, 3.2633462056758065
23, 1.5053887980045377
24, 4.9299912387096922
25, 1.8293218410000001
Module execution finished
See also: