Explained: IEmSerie;
Explained: Prognoz.Platform.Interop.Modeller.IEmSerie;
The Explained property determines explained variable.
If the explained variable is not defined, correct calculation of the ARIMA method is impossible.
To execute the example, add links to the Modeller, Stat system assemblies.
Sub ARIMACalc;
Var
ExprMod: IExpressModeller;
Serie: IEmSerie;
Ar: Array[14] Of Double;
Sett: IEmARIMASettings;
MisData: IEmMissingDataSettings;
Period: IEmPeriodSettings;
Begin
ExprMod := New ExpressModeller.Create;
Ar[0] := 56; Ar[1] := 45; Ar[2] := 23; Ar[3] := 45;
Ar[4] := 65; Ar[5] := 23; Ar[6] := 54; Ar[7] := 87;
Ar[8] := 67; Ar[9] := 98; Ar[10] := 89; Ar[13] := 79;
Ar[11] :=Double.Nan; Ar[12] :=Double.Nan;
Serie := ExprMod.Series.Add(Ar, "X1", "Data series 1");
Sett := ExprMod.CreateARIMASettings;
// Setting explained series
Sett.Explained := Serie;
// Setting constant
Sett.ConstantEstimate := 2.7;
// Setting non-seasonal parameters
Sett.AutoRegressOrder := 2;
Sett.DifferenceOrder := 1;
Sett.MovingAverageOrder := 1;
// Setting seasonal parameters
Sett.SeasonalAutoRegressOrder := 1;
Sett.SeasonalCycle := 4;
Sett.SeasonalDifferenceOrder := 1;
Sett.SeasonalMovingAverageOrder := 1;
//Setting maximum iteration number
Sett.MaximumIterations := 60;
// Select method of missing data treatment
MisData := Sett.MissingData;
MisData.Method := MissingDataMethod.NPointsAverage;
MisData.Parameter := 3;
// Setting calculation periods
Period := Sett.Period;
Period.BeginPeriod := 0;
Period.EndPeriod := 13;
Period.EndFore := 4;
// Performing calculation
ExprMod.EvaluateMethod("C:\ARIMA.html", Sett, True);
End Sub ARIMACalc;
Example execution result: the ARIMA method is calculated with specified parameters, calculation report is saved to C:\ARIMA.html file.
Imports Prognoz.Platform.Interop.Modeller;
Imports Prognoz.Platform.Interop.Stat;
…
Public Shared Sub Main(Params: StartParams);
Var
ExprMod: IExpressModeller;
Serie: IEmSerie;
Ar: Array[14] Of Double;
Sett: IEmARIMASettings;
MisData: IEmMissingDataSettings;
Period: IEmPeriodSettings;
Begin
ExprMod := New ExpressModeller.Create();
Ar[0] := 56; Ar[1] := 45; Ar[2] := 23; Ar[3] := 45;
Ar[4] := 65; Ar[5] := 23; Ar[6] := 54; Ar[7] := 87;
Ar[8] := 67; Ar[9] := 98; Ar[10] := 89; Ar[13] := 79;
Ar[11] :=Double.Nan; Ar[12] :=Double.Nan;
Serie := ExprMod.Series.Add(Ar, "X1", "Data series 1");
Sett := ExprMod.CreateARIMASettings();
// Setting explained series
Sett.Explained := Serie;
// Setting constant
Sett.ConstantEstimate := 2.7;
// Setting non-seasonal parameters
Sett.AutoRegressOrder := 2;
Sett.DifferenceOrder := 1;
Sett.MovingAverageOrder := 1;
// Setting seasonal parameters
Sett.SeasonalAutoRegressOrder := 1;
Sett.SeasonalCycle := 4;
Sett.SeasonalDifferenceOrder := 1;
Sett.SeasonalMovingAverageOrder := 1;
//Setting maximum iteration number
Sett.MaximumIterations := 60;
// Select method of missing data treatment
MisData := Sett.MissingData;
MisData.Method := MissingDataMethod.mdmNPointsAverage;
MisData.Parameter := 3;
// Setting calculationnbsp;periods
Period := Sett.Period;
Period.BeginPeriod := 0;
Period.EndPeriod := 13;
Period.EndFore := 4;
// Performing calculation
ExprMod.EvaluateMethod("C:\ARIMA.html", Sett, True);
End Sub;
Example execution result: the ARIMA method is calculated with specified parameters, calculation report is saved to C:\ARIMA.html file.
See also: