ExogenousCoefficients: Array;
The ExogenousCoefficients property determines initial values for exogenous variables coefficients.
Sub Main;
Var
ARIMA: SmArima;
serie, InitialValues: Array Of Double;
status, i: Integer;
d0: Double;
InitValues: IArimaSpecificationInitialValues;
Begin
ARIMA := New SmArima.Create;
serie := New Double[10];
serie[0] := 1;
serie[1] := 3;
serie[2] := -4;
serie[3] := -2;
serie[4] := 0;
serie[5] := 2;
serie[6] := 1.5;
serie[7] := 2;
serie[8] := 6;
serie[9] := 3;
ARIMA.Serie.Value := serie;
serie[0] := 10;
serie[1] := 20;
serie[2] := 12;
serie[3] := 0;
serie[4] := 0.5;
serie[5] := 5;
serie[6] := -1;
serie[7] := -3;
serie[8] := 15;
serie[9] := 3;
ARIMA.Exogenous.Add.Value := serie;
serie[0] := 0.1;
serie[1] := 1;
serie[2] := 1.2;
serie[3] := 4;
serie[4] := 0.4;
serie[5] := -0.25;
serie[6] := -0.9;
serie[7] := 0.5;
serie[8] := 1.4;
serie[9] := 2;
ARIMA.Exogenous.Add.Value := serie;
ARIMA.Forecast.LastPoint := 12;
ARIMA.ArimaSpecification.AutoRegressionOrder := 0;
ARIMA.ArimaSpecification.MovingAverageOrder := 1;
ARIMA.ModelCoefficients.Intercept.Mode := InterceptMode.AutoEstimate;
InitialValues := New Double[2];
InitialValues[0] := 0.1;
InitialValues[1] := 0.1;
InitValues := ARIMA.InitialValueS;
InitValues.ExogenousCoefficients := InitialValues;
InitValues.MovingAverage := InitialValues;
status := arima.Execute;
Debug.WriteLine("===Status=== ");
Debug.WriteLine(status);
Debug.WriteLine("=== Modeling series=== ");
For i := 0 To ARIMA.ModelPeriod.LastPoint - 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 modeling series:
Module execution started
===Status===
0
=== Modeling series ===
0, 3.0759759691996731
1, 7.3507323119292378
2, -4.0540008062954094
3, -2.2939666396478642
4, -1.7009401279657064
5, 0.58140812072136949
6, -0.012524376392192282
7, 0.65644540594370659
8, 5.6837422361466574
9, 3
Module execution finished
See also: