DifferenceOrder: Integer;
The DifferenceOrder property determines order of difference, that is order of differentiation for a source time series.
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.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.70461500304992752
2, 0.68151033674838268
3, -2.0721861912354949
4, 5.0773839531093898
5, -2.1150318515867808
6, 5.0326366740047339
7, 3.5628998700159471
8, 1.7563093717127582
9, 10.688641525844222
10, 3.3511995282471938
11, 7.7781482409019862
12, 2.9100507243221778
13, 2.578603256934362
14, 3.0881998031942892
15, 5.2003694651317369
16, 4.3520700733532891
17, 7.9292255865140948
18, 3.9064589932614453
19, 7.8442768863549581
20, 4.4756454620490782
21, 5.0051379244887277
22, 4.3115745807225441
23, 1.6693891697755907
24, 5.0985897352579652
25, 1.8293218410000001
Module execution finished
See also: