MissingData: IMissingData;
MissingData: Prognoz.Platform.Interop.Stat.SlMissingData;
The MissingData property determines missing data treatment parameters.
The MissingDataMethod missing data treatment method.Casewise cannot be used.
Add a link to the Stat system assembly.
Sub UserProc;
Var
Census2: SmCensus2;
Result: ICensus2Results;
s: Array[36] Of Double;
res, i: Integer;
Begin
Census2 := New SmCensus2.Create;
// Set values of the explained series
s[0] := 670.2000183; s[12] := Double.Nan; s[24] := 826.6160466;
s[1] := 576.0680563; s[13] := 642.418544; s[25] := Double.Nan;
s[2] := 717.6484268; s[14] := Double.Nan; s[26] := 931.5707266;
s[3] := 856.9105808; s[15] := Double.Nan; s[27] := 1026.666524;
s[4] := 885.4609516; s[16] := 884.504279; s[28] := Double.Nan;
s[5] := 1011.846431; s[17] := 1008.30908; s[29] := 1099.626392;
s[6] := 995.4496292; s[18] := 1108.36628; s[30] := 1189.16892;
s[7] := 1064.742231; s[19] := 1072.77175; s[31] := 1092.343791;
s[8] := 1033.324656; s[20] := 1019.18752; s[32] := 1087.503861;
s[9] := 780.8584552; s[21] := 895.560672; s[33] := 971.6522721;
s[10] := 657.503313; s[22] := 811.036101; s[34] := 826.2502823;
s[11] := 654.547579; s[23] := 756.617764; s[35] := 789.6322825;
Census2.Serie.Value := s;
// Determine parameters of identification period
Census2.ModelPeriod.FirstPoint := 1;
Census2.ModelPeriod.LastPoint := 36;
// Select missing data treatment method
Census2.MissingData.Method := MissingDataMethod.LinTrend;
// Determine parameters of seasonal component and seasonality type
Census2.SeasonalComponent.Mode := SeasonalityType.Multiplicative;
Census2.SeasonalComponentCycleType := SeasonalityCycleType.Month;
// Define working days adjustments
Census2.TraidingDaysAdjustment := TraidingDaysAdj.Auto;
// Determine parameters of period start
Census2.StartPeriod.Year := 1;
Census2.StartPeriod.MonthOrQuarter := 1;
// Determine Sigma level
Census2.SigmaLevel.Lower := 0.</font><font color="#008000">9</font><font color="#000000">;<br/> Census2.SigmaLevel.Upper := </font><font color="#008000">2</font><font color="#000000">;<br/> </font><font color="#008000">// Calculate method<br/> </font><font color="#000000"> res := Census2.Execute;<br/> Result := Census2.Results;<br/> </font><font color="#008080">If</font><font color="#000000"> res <> </font><font color="#008000">0</font><font color="#000000"> </font><font color="#008080">Then</font><font color="#000000"><br/> Debug.WriteLine(census2.Errors);<br/> </font><font color="#008080">Else</font><font color="#000000"><br/> Debug.WriteLine(</font><font color="#800000">"=== Prior adjusted series ==="</font><font color="#000000">);<br/> Debug.Indent;<br/> </font><font color="#008080">For</font><font color="#000000"> i := </font><font color="#008000">0</font><font color="#000000"> </font><font color="#008080">To</font><font color="#000000"> Result.B1.Length - </font><font color="#008000">1</font><font color="#000000"> </font><font color="#008080">Do</font><font color="#000000"><br/> Debug.WriteLine(Result.B1[i]);<br/> </font><font color="#008080">End</font><font color="#000000"> </font><font color="#008080">For</font><font color="#000000">;<br/> Debug.Unindent;<br/> Debug.WriteLine(</font><font color="#800000">"=== Trend cyclic component ==="</font><font color="#000000">);<br/> Debug.Indent;<br/> </font><font color="#008080">For</font><font color="#000000"> i := </font><font color="#008000">0</font><font color="#000000"> </font><font color="#008080">To</font><font color="#000000"> Result.B2.Length - </font><font color="#008000">1</font><font color="#000000"> </font><font color="#008080">Do</font><font color="#000000"><br/> Debug.WriteLine(Result.B2[i]);<br/> </font><font color="#008080">End</font><font color="#000000"> </font><font color="#008080">For</font><font color="#000000">;<br/> Debug.Unindent;<br/> Debug.WriteLine(</font><font color="#800000">"=== Seasonal adjustment ==="</font><font color="#000000">);<br/> Debug.Indent;<br/> </font><font color="#008080">For</font><font color="#000000"> i := </font><font color="#008000">0</font><font color="#000000"> </font><font color="#008080">To</font><font color="#000000"> Result.B6.Length - </font><font color="#008000">1</font><font color="#000000"> </font><font color="#008080">Do</font><font color="#000000"><br/> Debug.WriteLine(Result.B6[i]);<br/> </font><font color="#008080">End</font><font color="#000000"> </font><font color="#008080">For</font><font color="#000000">;<br/> Debug.Unindent;<br/> Debug.WriteLine(</font><font color="#800000">"=== Non-modified S-I differences or relations ==="</font><font color="#000000">);<br/> Debug.Indent;<br/> </font><font color="#008080">For</font><font color="#000000"> i := </font><font color="#008000">0</font><font color="#000000"> </font><font color="#008080">To</font><font color="#000000"> Result.B8.Length - </font><font color="#008000">1</font><font color="#000000"> </font><font color="#008080">Do</font><font color="#000000"><br/> Debug.WriteLine(Result.B8[i]);<br/> </font><font color="#008080">End</font><font color="#000000"> </font><font color="#008080">For</font><font color="#000000">;<br/> Debug.Unindent;<br/> Debug.WriteLine(</font><font color="#800000">"=== Irregular component ==="</font><font color="#000000">);<br/> Debug.Indent;<br/> </font><font color="#008080">For</font><font color="#000000"> i := </font><font color="#008000">0</font><font color="#000000"> </font><font color="#008080">To</font><font color="#000000"> Result.B13.Length - </font><font color="#008000">1</font><font color="#000000"> </font><font color="#008080">Do</font><font color="#000000"><br/> Debug.WriteLine(Result.B13[i]);<br/> </font><font color="#008080">End</font><font color="#000000"> </font><font color="#008080">For</font><font color="#000000">;<br/> Debug.Unindent;<br/> Debug.WriteLine(</font><font color="#800000">"=== Seasonal component ==="</font><font color="#000000">);<br/> Debug.Indent;<br/> </font><font color="#008080">For</font><font color="#000000"> i := </font><font color="#008000">0</font><font color="#000000"> </font><font color="#008080">To</font><font color="#000000"> Result.D10.Length - </font><font color="#008000">1</font><font color="#000000"> </font><font color="#008080">Do</font><font color="#000000"><br/> Debug.WriteLine(Result.D10[i]);<br/> </font><font color="#008080">End</font><font color="#000000"> </font><font color="#008080">For</font><font color="#000000">;<br/> Debug.Unindent;<br/> Debug.WriteLine(</font><font color="#800000">"=== Final trend-cyclic component ==="</font><font color="#000000">);<br/> Debug.Indent;<br/> </font><font color="#008080">For</font><font color="#000000"> i := </font><font color="#008000">0</font><font color="#000000"> </font><font color="#008080">To</font><font color="#000000"> Result.D12.Length - </font><font color="#008000">1</font><font color="#000000"> </font><font color="#008080">Do</font><font color="#000000"><br/> Debug.WriteLine(Result.D12[i]);<br/> </font><font color="#008080">End</font><font color="#000000"> </font><font color="#008080">For</font><font color="#000000">;<br/> Debug.Unindent;<br/> </font><font color="#008080">End</font><font color="#000000"> </font><font color="#008080">If</font><font color="#000000">;<br/> </font><font color="#008080">End</font><font color="#000000"> </font><font color="#008080">Sub</font><font color="#000000"> UserProc;</font>
Imports Prognoz.Platform.Interop.Stat;
…
Public Shared Sub Main(Params: StartParams);
Var
Census2: SmCensus2;
Result: ICensus2Results;
s: Array[36] Of Double;
res, i: Integer;
B1, B2, B6, B8, B13, D10: System.Array;
Begin
Census2 := New SmCensus2.Create();
// Set values of the explained series
s[0] := 670.2000183; s[12] := Double.Nan; s[24] := 826.6160466;
s[1] := 576.0680563; s[13] := 642.418544; s[25] := Double.Nan;
s[2] := 717.6484268; s[14] := Double.Nan; s[26] := 931.5707266;
s[3] := 856.9105808; s[15] := Double.Nan; s[27] := 1026.666524;
s[4] := 885.4609516; s[16] := 884.504279; s[28] := Double.Nan;
s[5] := 1011.846431; s[17] := 1008.30908; s[29] := 1099.626392;
s[6] := 995.4496292; s[18] := 1108.36628; s[30] := 1189.16892;
s[7] := 1064.742231; s[19] := 1072.77175; s[31] := 1092.343791;
s[8] := 1033.324656; s[20] := 1019.18752; s[32] := 1087.503861;
s[9] := 780.8584552; s[21] := 895.560672; s[33] := 971.6522721;
s[10] := 657.503313; s[22] := 811.036101; s[34] := 826.2502823;
s[11] := 654.547579; s[23] := 756.617764; s[35] := 789.6322825;
Census2.Serie.Value := s;
// Determine parameters of identification period
Census2.ModelPeriod.FirstPoint := 1;
Census2.ModelPeriod.LastPoint := 36;
// Select missing data treatment method
Census2.MissingData.Method := MissingDataMethod.mdmLinTrend;
// Determine parameters of seasonal component and seasonality type
Census2.SeasonalComponent.Mode := SeasonalityType.sstMultiplicative;
Census2.SeasonalComponentCycleType := SeasonalityCycleType.sctMonth;
// Set working days adjustment
Census2.TraidingDaysAdjustment := TraidingDaysAdj.tdaAuto;
// Determine parameters of period start
Census2.StartPeriod.Year := 1;
Census2.StartPeriod.MonthOrQuarter := 1;
// Determine Sigma level
Census2.SigmaLevel.Lower := 0.</font><font color="#008000">9</font><font color="#000000">;<br/> Census2.SigmaLevel.Upper := </font><font color="#008000">2</font><font color="#000000">; <br/> </font><font color="#008000">// Calculate method<br/> </font><font color="#000000"> res := Census2.Execute();<br/> Result := Census2.Results;<br/> </font><font color="#008080">If</font><font color="#000000"> res <> </font><font color="#008000">0</font><font color="#000000"> </font><font color="#008080">Then</font><font color="#000000"><br/> System.Diagnostics.Debug.WriteLine(census2.Errors);<br/> </font><font color="#008080">Else</font><font color="#000000"><br/> System.Diagnostics.Debug.WriteLine(</font><font color="#800000">"=== Prior adjusted series ==="</font><font color="#000000">);<br/> System.Diagnostics.Debug.Indent();<br/> B1 := Result.B1;<br/> </font><font color="#008080">For</font><font color="#000000"> i := </font><font color="#008000">0</font><font color="#000000"> </font><font color="#008080">To</font><font color="#000000"> B1.Length - </font><font color="#008000">1</font><font color="#000000"> </font><font color="#008080">Do</font><font color="#000000"><br/> System.Diagnostics.Debug.WriteLine(B1[i]);<br/> </font><font color="#008080">End</font><font color="#000000"> </font><font color="#008080">For</font><font color="#000000">;<br/> System.Diagnostics.Debug.Unindent();<br/> System.Diagnostics.Debug.WriteLine(</font><font color="#800000">"=== Trend cyclic component ==="</font><font color="#000000">);<br/> System.Diagnostics.Debug.Indent();<br/> B2 := Result.B2;<br/> </font><font color="#008080">For</font><font color="#000000"> i := </font><font color="#008000">0</font><font color="#000000"> </font><font color="#008080">To</font><font color="#000000"> B2.Length - </font><font color="#008000">1</font><font color="#000000"> </font><font color="#008080">Do</font><font color="#000000"><br/> System.Diagnostics.Debug.WriteLine(B2[i]);<br/> </font><font color="#008080">End</font><font color="#000000"> </font><font color="#008080">For</font><font color="#000000">;<br/> System.Diagnostics.Debug.Unindent();<br/> System.Diagnostics.Debug.WriteLine(</font><font color="#800000">"=== Seasonal adjustment ==="</font><font color="#000000">);<br/> System.Diagnostics.Debug.Indent();<br/> B6 := Result.B6;<br/> </font><font color="#008080">For</font><font color="#000000"> i := </font><font color="#008000">0</font><font color="#000000"> </font><font color="#008080">To</font><font color="#000000"> B6.Length - </font><font color="#008000">1</font><font color="#000000"> </font><font color="#008080">Do</font><font color="#000000"><br/> System.Diagnostics.Debug.WriteLine(B6[i]);<br/> </font><font color="#008080">End</font><font color="#000000"> </font><font color="#008080">For</font><font color="#000000">;<br/> System.Diagnostics.Debug.Unindent();<br/> System.Diagnostics.Debug.WriteLine(</font><font color="#800000">"=== Non-modified S-I differencies or relations ==="</font><font color="#000000">);<br/> System.Diagnostics.Debug.Indent();<br/> B8 := Result.B8;<br/> </font><font color="#008080">For</font><font color="#000000"> i := </font><font color="#008000">0</font><font color="#000000"> </font><font color="#008080">To</font><font color="#000000"> B8.Length - </font><font color="#008000">1</font><font color="#000000"> </font><font color="#008080">Do</font><font color="#000000"><br/> System.Diagnostics.Debug.WriteLine(B8[i]);<br/> </font><font color="#008080">End</font><font color="#000000"> </font><font color="#008080">For</font><font color="#000000">;<br/> System.Diagnostics.Debug.Unindent();<br/> System.Diagnostics.Debug.WriteLine(</font><font color="#800000">"=== Irregular component ==="</font><font color="#000000">);<br/> System.Diagnostics.Debug.Indent();<br/> B13 := Result.B13;<br/> </font><font color="#008080">For</font><font color="#000000"> i := </font><font color="#008000">0</font><font color="#000000"> </font><font color="#008080">To</font><font color="#000000"> B13.Length - </font><font color="#008000">1</font><font color="#000000"> </font><font color="#008080">Do</font><font color="#000000"><br/> System.Diagnostics.Debug.WriteLine(B13[i]);<br/> </font><font color="#008080">End</font><font color="#000000"> </font><font color="#008080">For</font><font color="#000000">;<br/> System.Diagnostics.Debug.Unindent();<br/> System.Diagnostics.Debug.WriteLine(</font><font color="#800000">"=== Seasonal component ==="</font><font color="#000000">);<br/> System.Diagnostics.Debug.Indent();<br/> D10 := Result.D10;<br/> </font><font color="#008080">For</font><font color="#000000"> i := </font><font color="#008000">0</font><font color="#000000"> </font><font color="#008080">To</font><font color="#000000"> D10.Length - </font><font color="#008000">1</font><font color="#000000"> </font><font color="#008080">Do</font><font color="#000000"><br/> System.Diagnostics.Debug.WriteLine(D10[i]);<br/> </font><font color="#008080">End</font><font color="#000000"> </font><font color="#008080">For</font><font color="#000000">;<br/> System.Diagnostics.Debug.Unindent();<br/> System.Diagnostics.Debug.WriteLine(</font><font color="#800000">"=== Final trend-cyclic component ==="</font><font color="#000000">);<br/> System.Diagnostics.Debug.Indent();<br/> D12 := Result.D12;<br/> </font><font color="#008080">For</font><font color="#000000"> i := </font><font color="#008000">0</font><font color="#000000"> </font><font color="#008080">To</font><font color="#000000"> D12.Length - </font><font color="#008000">1</font><font color="#000000"> </font><font color="#008080">Do</font><font color="#000000"><br/> System.Diagnostics.Debug.WriteLine(D12[i]);<br/> </font><font color="#008080">End</font><font color="#000000"> </font><font color="#008080">For</font><font color="#000000">;<br/> System.Diagnostics.Debug.Unindent();<br/> </font><font color="#008080">End</font><font color="#000000"> </font><font color="#008080">If</font><font color="#000000">;<br/> </font><font color="#008080">End</font><font color="#000000"> </font><font color="#008080">Sub</font><font color="#000000">;</font>
After executing the example, the console displays calculation results of the method X11.
See also: