MissingData: IMissingData;
MissingData: Prognoz.Platform.Interop.Stat.IMissingData;
The MissingData property determines missing data treatment parameters.
By default missing data is not treated.
Add a link to the Stat system assembly.
Sub UserProc;
Var
MS: SmMedianSmoothing;
s: Array[10] Of Double;
ar: Array Of Double;
res, i: Integer;
Begin
MS := New SmMedianSmoothing.Create;
// Set variable values
s[0] := 6; s[1] := 5;
s[2] := 7; s[3] := Double.Nan;
s[4] := 1; s[5] := 10;
s[6] := 9; s[7] := 10;
s[8] := 8; s[9] := Double.Nan;
// Determine explained series
MS.Serie.Value := s;
// Define parameters of sample period
MS.ModelPeriod.FirstPoint := 1;
MS.ModelPeriod.LastPoint := 10;
// Determine missing data treatment parameters
MS.MissingData.Method := MissingDataMethod.SampleAverage;
// Determine the time interval, at which element average will be determined
MS.Width := 2;
// Calculate the method and output the results
res := MS.Execute;
If res <> 0 Then
Debug.WriteLine(MS.Errors);
Else
Debug.WriteLine("Durbin-Watson statistic: " + Ms.SummaryStatistics.DW.ToString);
Debug.WriteLine("Modeling series");
Debug.Indent;
ar := MS.Fitted;
For i := 0 To Ms.ModelPeriod.LastPoint - 1 Do
Debug.WriteLine((i + 1).ToString + ". " + ar[i].ToString);
End For;
Debug.Unindent;
Debug.WriteLine("Residuals");
Debug.Indent;
For i := 0 To Ms.ModelPeriod.LastPoint - 1 Do
Debug.WriteLine(i.ToString + ", " + MS.Residuals[i].ToString);
End For;
Debug.Unindent;
End If;
End Sub UserProc;
After executing the example the console window displays the specified statistic, the modeling series, and the residual 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
MS: SmMedianSmoothing;
s: Array[10] Of Double;
ar: System.Array;
res, i: Integer;
Begin
MS := New SmMedianSmoothing.Create();
// Set variable values
s[0] := 6; s[1] := 5;
s[2] := 7; s[3] := Double.Nan;
s[4] := 1; s[5] := 10;
s[6] := 9; s[7] := 10;
s[8] := 8; s[9] := Double.Nan;
// Determine explained series
MS.Serie.Value := s;
// Define parameters of sample period
MS.ModelPeriod.FirstPoint := 1;
MS.ModelPeriod.LastPoint := 10;
// Determine missing data treatment parameters
MS.MissingData.Method := MissingDataMethod.mdmSampleAverage;
// Determine the time interval, at which element average will be determined
MS.Width := 2;
// Calculate the method and output the results
res := MS.Execute();
If res <> 0 Then
System.Diagnostics.Debug.WriteLine(MS.Errors);
Else
System.Diagnostics.Debug.WriteLine("Durbin-Watson statistic: " + Ms.SummaryStatistics.DW.ToString());
System.Diagnostics.Debug.WriteLine("Modeling series");
System.Diagnostics.Debug.Indent();
ar := MS.Fitted;
For i := 0 To Ms.ModelPeriod.LastPoint - 1 Do
System.Diagnostics.Debug.WriteLine((i + 1).ToString() + ". " + ar[i].ToString());
End For;
System.Diagnostics.Debug.Unindent();
System.Diagnostics.Debug.WriteLine("Residuals");
System.Diagnostics.Debug.Indent();
For i := 0 To Ms.ModelPeriod.LastPoint - 1 Do
System.Diagnostics.Debug.WriteLine(i.ToString() + ", " + MS.Residuals.GetValue(i).ToString());
End For;
System.Diagnostics.Debug.Unindent();
End If;
End Sub;
See also: