Serie: IEmSerie;
Serie: Prognoz.Platform.Interop.Modeller.IEmSerie;
The Serie property determines a smoothable series.
If a smoothable series is not specified, correct calculation of the Census 1 method is not possible.
Minimum number of observations in the series must satisfy the inequality: NumberOfObservations = (SeasonalityPeriod * 2 + 1). Number of observations is returned by the IEmSerie.Count property; seasonality period value is determined by the IEmCensus1Settings.SeasonalityCycle property.
To execute the example, add links to the Modeller, Stat system assemblies.
Sub Census1;
Var
ExprMod: IExpressModeller;
Serie: IEmSerie;
Ar: Array[14] Of Double;
Sett: IEmCensus1Settings;
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.CreateCensus1Settings;
// Setting smoothable series
Sett.Serie := Serie;
// Setting seasonality type
Sett.Seasonality := SeasonalityType.Multiplicative;
// Setting seasonality period
Sett.SeasonalityCycle := 4;
// Indicating that moving average is not used
Sett.CenterMovingAverage := False;
// Setting calculation periods
Period := Sett.Period;
Period.BeginPeriod := 0;
Period.EndPeriod := 13;
Period.EndFore := 4;
// Performing calculation
ExprMod.EvaluateMethod("C:\Census1.html", Sett, True);
End Sub Census1;
Example execution result: the Census 1 method is calculated with set parameters, calculation report is saved to the file C:\Census1.html.
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: IEmCensus1Settings;
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.CreateCensus1Settings();
// Setting smoothable series
Sett.Serie := Serie;
// Setting seasonality type
Sett.Seasonality := SeasonalityType.sstMultiplicative;
// Setting seasonality period
Sett.SeasonalityCycle := 4;
// Indicating that moving average is not used
Sett.CenterMovingAverage := False;
// Setting calculation periods
Period := Sett.Period;
Period.BeginPeriod := 0;
Period.EndPeriod := 13;
Period.EndFore := 4;
// Performing calculation
ExprMod.EvaluateMethod("C:\Census1.html", Sett, True);
End Sub;
Example execution result: the Census 1 method is calculated with set parameters, calculation report is saved to the file C:\Census1.html.
See also: