SpecifiedValue: Double;
SpecifiedValue: double;
The SpecifiedValue property determines an additional parameter for the missing data treatment method named Specified value (MissingDataMethod.SpecifiedValue).
For this method the SpecifiedValue property determines the value, with which missing data of the modeled series is 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
LR: ISmLinearRegress;
serie: Array[10] Of Double;
MD: IMissingData;
i, res: Integer;
Begin
LR := New SmLinearRegress.Create;
serie[0] := 0;
serie[1] := 0;
serie[2] := 0.878471616;
serie[3] := 0.85401205;
serie[4] := 3.785177462;
serie[5] := Double.Nan;
serie[6] := 5.345764494;
serie[7] := Double.Nan;
serie[8] := 4.864879297;
serie[9] := 7.765499027;
LR.Explained.Value := serie;
MD := LR.MissingData;
// Advanced parameter for the method of missing data treatment "Specified value"
MD.Method := MissingDataMethod.SpecifiedValue;
MD.SpecifiedValue := 2.22;
res := LR.Execute;
Debug.WriteLine("Output series");
Debug.Indent;
For i := 0 To LR.Explained.Value.Length - 1 Do
Debug.WriteLine(LR.Explained.Value[i]);
End For;
Debug.Unindent;
Debug.WriteLine("Source series");
Debug.Indent;
For i := 0 To LR.Explained.OriginalValue.Length - 1 do
Debug.WriteLine(LR.Explained.OriginalValue[i]);
End For;
Debug.Unindent;
End Sub UserProc;
After executing the example the console window displays source series and the series calculated using the method of missing data treatment Specified Value:
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
LR: ISmLinearRegress;
Value, OriginalValue: System.Array;
serie: Array[10] Of double;
MD: IMissingData;
i, res: integer;
Begin
LR := New SmLinearRegress.Create();
serie[0] := 0;
serie[1] := 0;
serie[2] := 0.878471616;
serie[3] := 0.85401205;
serie[4] := 3.785177462;
serie[5] := Double.Nan;
serie[6] := 5.345764494;
serie[7] := Double.Nan;
serie[8] := 4.864879297;
serie[9] := 7.765499027;
LR.Explained.Value := serie;
MD := LR.MissingData;
// Advanced parameter for the method of missing data treatment "Specified value"
MD.Method := MissingDataMethod.mdmSpecifiedValue;
MD.SpecifiedValue := 2.22;
res := LR.Execute();
Value := LR.Explained.Value;
OriginalValue := LR.Explained.OriginalValue;
System.Diagnostics.Debug.WriteLine("Output series");
System.Diagnostics.Debug.Indent();
For i := 0 To Value.Length - 1 Do
System.Diagnostics.Debug.WriteLine(Value[i]);
End For;
System.Diagnostics.Debug.Unindent();
System.Diagnostics.Debug.WriteLine("Source series");
System.Diagnostics.Debug.Indent();
For i := 0 To OriginalValue.Length - 1 do
System.Diagnostics.Debug.WriteLine(OriginalValue[i]);
End For;
System.Diagnostics.Debug.Unindent();
End Sub;
See also: