Serie: IEmSerie;
Serie: Prognoz.Platform.Interop.Modeller.IEmSerie;
The Serie property determines a source series.
If the source series is not specified, correct calculation of the Autoregression method is not possible.
To execute the example, add a link to the Modeller system assembly.
Sub AutoRegression;
Var
ExprMod: IExpressModeller;
Serie: IEmSerie;
Ar: Array[14] Of Double;
Sett: IEmAutoRegressionSettings;
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.CreateAutoRegressionSettings;
// Setting explained series
Sett.Serie := Serie;
// Setting autoregression order
Sett.AutoRegressionOrder := 2;
// Using constant in calculation
Sett.HasConstant := True;
// Setting calculation periods
Period := Sett.Period;
Period.BeginPeriod := 0;
Period.EndPeriod := 13;
Period.EndFore := 4;
// Performing calculation
ExprMod.EvaluateMethod("C:\AutoRegression.html", Sett, True);
End Sub AutoRegression;
Example execution result: the Autoregression method is calculated with set parameters, calculation report is saved to the file C:\AutoRegression.html.
Imports Prognoz.Platform.Interop.Modeller;
…
Public Shared Sub Main(Params: StartParams);
Var
ExprMod: IExpressModeller;
Serie: IEmSerie;
Ar: Array[14] Of Double;
Sett: IEmAutoRegressionSettings;
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.CreateAutoRegressionSettings();
// Setting explained series
Sett.Serie := Serie;
// Setting autoregression order
Sett.AutoRegressionOrder := 2;
// Using constant in calculation
Sett.HasConstant := True;
// Setting calculation periods
Period := Sett.Period;
Period.BeginPeriod := 0;
Period.EndPeriod := 13;
Period.EndFore := 4;
// Performing calculation
ExprMod.EvaluateMethod("C:\AutoRegression.html", Sett, True);
End Sub;
Example execution result: the Autoregression method is calculated with set parameters, calculation report is saved to the file C:\AutoRegression.html.
See also: