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
Slide: SmSlideSmoothing;
s: Array[10] Of Double;
res, i: Integer;
Begin
Slide := New SmSlideSmoothing.Create;
// Set variable values
s[0] := 670.2; s[1] := 576.06;
s[2] := 856.9; s[3] := Double.Nan;
s[4] := 885.4; s[5] := 1011.8;
s[6] := 995.44; s[7] := 1064.74;
s[8] := 780.85; s[9] := Double.Nan;
// Determine source series parameters
Slide.Serie.Value := s;
// Define parameters of sample period
Slide.ModelPeriod.FirstPoint := 1;
Slide.ModelPeriod.LastPoint := 10;
// Determine missing data treatment method
Slide.MissingData.Method := MissingDataMethod.SampleAverage;
// Determine the time interval, at which element average will be determined
Slide.Width := 3;
// Determine whether moving average will be centered
Slide.CenterMovingAverage := True;
// Execute calculation and display results
res := Slide.Execute;
If res <> 0 Then
Debug.WriteLine(Slide.Errors);
Else
Debug.WriteLine("Modeling series");
For i := 0 To Slide.Fitted.Length - 1 Do
Debug.WriteLine(" " + (i + 1).ToString + ". " + Slide.Fitted[i].ToString);
End For;
Debug.WriteLine("Residuals");
For i := 0 To Slide.Residuals.Length - 1 Do
Debug.WriteLine(" " + (i + 1).ToString + ". " + Slide.Residuals[i].ToString);
End For;
Debug.WriteLine("Durbin-Watson statistic: " + Slide.SummaryStatistics.DW.ToString);
End If;
End Sub UserProc;
After executing the example the console window displays the modeling series, residuals, and summary statistics.
See also: