MissingData: IMissingData;
MissingData: Prognoz.Platform.Interop.Stat.SlMissingData;
The MissingData property determines missing data treatment parameters.
If the model is estimated with seasonality, the method of missing data treatment is MissingDataMethod.Casewise cannot be used.
Add a link to the Stat system assembly.
Sub UserProc;
Var
Method: SmExponentialSmoothing;
serie: Array[15] Of Double;
Seasonal: ISeasonal;
status, i: Integer;
Begin
Method := New SmExponentialSmoothing.Create;
serie[0] := 670.2000183; serie[1] := 576.0680563; serie[2] := Double.Nan;
serie[3] := 856.9105808; serie[4] := 885.4609516; serie[5] := 1011.846431;
serie[6] := 995.4496292; serie[7] := 1064.74221; serie[8] := Double.Nan;
serie[9] := 717.6484268; serie[10] := 751.9611194; serie[11] := 654.5472579;
serie[12] := 678.2380139; serie[13] := 642.4128544; serie[14] := Double.Nan;
Method.Serie.Value := serie;
Method.Forecast.LastPoint := 40;
Method.MissingData.Method := MissingDataMethod.LinInterpolation;
Seasonal := Method.SeasonalComponent;
Seasonal.Mode := SeasonalityType.Additive;
Seasonal.Cycle := 4;
status := Method.Execute;
If status <> 0 Then
Debug.WriteLine(Method.Errors);
Else
Debug.WriteLine("=== Model series ===");
Debug.Indent;
For i := 0 To Method.Fitted.Length - 1 Do
Debug.WriteLine(Method.Fitted[i]);
End For;
Debug.Unindent;
End If;
End Sub UserProc;
After executing the example the console window displays the modeling series.
The requirements and result of the Fore.NET example execution match with those in the Fore example.
Imports Prognoz.Platform.Interop.Stat;
…
Public Shared Sub Main(Params: StartParams);
Var
Method: SmExponentialSmoothing;
serie: Array[15] Of Double;
Seasonal: ISeasonal;
status, i: Integer;
Fitted: System.Array;
Begin
Method := New SmExponentialSmoothing.Create();
serie[0] := 670.2000183; serie[1] := 576.0680563; serie[2] := Double.Nan;
serie[3] := 856.9105808; serie[4] := 885.4609516; serie[5] := 1011.846431;
serie[6] := 995.4496292; serie[7] := 1064.74221; serie[8] := Double.Nan;
serie[9] := 717.6484268; serie[10] := 751.9611194; serie[11] := 654.5472579;
serie[12] := 678.2380139; serie[13] := 642.4128544; serie[14] := Double.Nan;
Method.Serie.Value := serie;
Method.Forecast.LastPoint := 40;
Method.MissingData.Method := MissingDataMethod.mdmLinInterpolation;
Seasonal := Method.SeasonalComponent;
Seasonal.Mode := SeasonalityType.sstAdditive;
Seasonal.Cycle := 4;
status := Method.Execute();
If status <> 0 Then
System.Diagnostics.Debug.WriteLine(Method.Errors);
Else
System.Diagnostics.Debug.WriteLine("=== Model series ===");
System.Diagnostics.Debug.Indent();
Fitted := Method.Fitted;
For i := 0 To Method.Fitted.Length - 1 Do
System.Diagnostics.Debug.WriteLine(Fitted[i]);
End For;
System.Diagnostics.Debug.Unindent();
End If;
End Sub;
See also: