MissingData: 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.residual series.
See also: