SpecifiedVector: Array;
SpecifiedVector: System.Array;
The SpecifiedVector property defines additional parameters for the missing data treatment methods Pattern (MissingDataMethod.Pattern) and Overlay (MissingDataMethod.Overlay).
For these methods the SpecifiedVector property determines the series, based on which the missing data of modeled series are to be substituted.
For other methods of missing data treatment this property is not relevant.
To execute the example, add a link to the Stat system assembly.
Sub UserProc;
Var
FillGaps: SmFillGapsProcedure;
Series: ISlSeries;
serie, OverlaySerie: Array[10] Of Double;
MD: IMissingData;
// Data output procedure
Sub Print(Data: Array Of Double);
Var
i: Integer;
Begin
Debug.Indent;
For i := 0 To Data.Length - 1 Do
If Double.IsNan(Data[i]) Then
Debug.WriteLine("----empty---");
Else
Debug.WriteLine(i.ToString + " " + Data[i].ToString);
End If;
End For;
Debug.Unindent;
End Sub Print;
Begin
FillGaps := New SmFillGapsProcedure.Create;
// Modeled series
serie[0] := 0;
serie[1] := 0;
serie[2] := 0.878471616;
serie[3] := 0.85401205;
serie[4] := Double.Nan;
serie[5] := 1.28083579;
serie[6] := Double.Nan;
serie[7] := 4.237308214;
serie[8] := 4.864879297;
serie[9] := 7.765499027;
Series := FillGaps.InputSeries;
Series.Add.Value := serie;
// The series from which values are taken to fill missing data
OverlaySerie[0] := 0;
OverlaySerie[1] := 1;
OverlaySerie[2] := 2;
OverlaySerie[3] := 3;
OverlaySerie[4] := 4;
OverlaySerie[5] := 5;
OverlaySerie[6] := 6;
OverlaySerie[7] := 7;
OverlaySerie[8] := 8;
OverlaySerie[9] := 9;
Series := FillGaps.InputSeries;
Series.Add.Value := serie;
MD := FillGaps.MissingData;
// Method of missing data treatment
MD.Method := MissingDataMethod.Overlay;
// Advanced parameter for methods of missing data treatment "Values of specified series"
MD.SpecifiedVector := OverlaySerie;
Debug.WriteLine("Source series");
Print(Series.Item(0).Value);
FillGaps.Execute;
Debug.WriteLine("Output series");
Print(Series.Item(0).Value);
End Sub UserProc;
After executing the example the console window displays source series and the series calculated using the method of missing data treatment Values of specified 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 Print(Data: System.Array);
Var
i: Integer;
Begin
System.Diagnostics.Debug.Indent();
For i := 0 To Data.Length - 1 Do
If Double.IsNan(Data.GetValue(i) As double) Then
System.Diagnostics.Debug.WriteLine("---empty---");
Else
System.Diagnostics.Debug.WriteLine(i.ToString() + " " + Data.GetValue(i));
End If;
End For;
System.Diagnostics.Debug.Unindent();
End Sub Print;
Public Shared Sub Main(Params: StartParams);
Var
FillGaps: SmFillGapsProcedure;
Series: ISlSeries;
serie, OverlaySerie: Array[10] Of Double;
MD: IMissingData;
Begin
FillGaps := New SmFillGapsProcedure.Create();
// Modeled series
serie[0] := 0;
serie[1] := 0;
serie[2] := 0.878471616;
serie[3] := 0.85401205;
serie[4] := Double.Nan;
serie[5] := 1.28083579;
serie[6] := Double.Nan;
serie[7] := 4.237308214;
serie[8] := 4.864879297;
serie[9] := 7.765499027;
Series := FillGaps.InputSeries;
Series.Add().Value := serie;
// The series from which values are taken to fill missing data
OverlaySerie[0] := 0;
OverlaySerie[1] := 1;
OverlaySerie[2] := 2;
OverlaySerie[3] := 3;
OverlaySerie[4] := 4;
OverlaySerie[5] := 5;
OverlaySerie[6] := 6;
OverlaySerie[7] := 7;
OverlaySerie[8] := 8;
OverlaySerie[9] := 9;
Series := FillGaps.InputSeries;
Series.Add().Value := serie;
MD := FillGaps.MissingData;
// Method of missing data treatment
MD.Method := MissingDataMethod.mdmOverlay;
// Advanced parameter for methods of missing data treatment "Values of specified series"
MD.SpecifiedVector := OverlaySerie;
System.Diagnostics.Debug.WriteLine("Source series");
Print(Series.Item[0].Value);
FillGaps.Execute();
System.Diagnostics.Debug.WriteLine("Output series");
Print(Series.Item[0].Value);
End Sub;
See also: