CycleSeries: ITimeSeries;
CycleSeries: Prognoz.Platform.Interop.Ms.ITimeSeries;
The CycleSeries property returns cyclic component of the source series.
This interface can also be used to get:
IMsBpfResult.NonCyclicalSeries. Non-cyclic component of source series.
IMsBpfResult.Weights. Weights.
Custom method of calculation, which returns forecasting values for any forecasting calculation method is given.
Add links to the Ms, Stat system assemblies.
Public Function BpfResult(Result: Variant): ITimeSeries;
Var
BpfRes: IMsBpfResult;
Series: ITimeSeries;
Begin
BpfRes := Result As IMsBpfResult;
// Display method name
Debug.WriteLine("Method name: " + BpfRes.BaseMethod.Name);
Debug.WriteLine("");
// Get modeling series and display it in the console window
Series := BpfRes.Fitted;
Debug.WriteLine("Modeling series");
Print(Series);
// Get residual series and display it in the console window
Series := BpfRes.Residuals;
Debug.WriteLine("Residual series");
Print(Series);
// Get output series and display it in the console window
Series := BpfRes.TimeSeries;
Debug.WriteLine("Output series");
Print(Series);
// Return forecasting series
Return BpfRes.NonCyclicalSeries;
End Function BpfResult;
After executing the example the console window displays calculation results of the Baxter-King filter.
This custom method can be used in determinate equation, in calculator in time series analysis and in expression editor. For example, the use of custom method in determinate equation:
IMSBPFRESULT_CYCLESERIES.BpfResult(Bpf(X1, Null, 1, 2, 5))
Where:
IMSBPFRESULT_CYCLESERIES. Identifier of the unit including custom method.
BpfResult. Custom method name.
Bpf. The Baxter-King filter calculation method.
X1. Model factor.
The requirements and result of the Fore.NET example execution match with those in the Fore example.
Imports Prognoz.Platform.Interop.ForeSystem;
Imports Prognoz.Platform.Interop.Ms;
Imports Prognoz.Platform.Interop.Stat;
…
Public Shared Function BpfResult(Result: object): ITimeSeries;
Var
BpfRes: IMsBpfResult;
Series: ITimeSeries;
Begin
BpfRes := Result As IMsBpfResult;
// Display method name
System.Diagnostics.Debug.WriteLine("Method name: " + BpfRes.BaseMethod.Name);
System.Diagnostics.Debug.WriteLine("");
// Get modeling series and display it in the console window
Series := BpfRes.Fitted;
System.Diagnostics.Debug.WriteLine("Modeling series");
Print(Series);
// Get residual series and display it in the console window
Series := BpfRes.Residuals;
System.Diagnostics.Debug.WriteLine("Residual series");
Print(Series);
// Get output series and display it in the console window
Series := BpfRes.TimeSeries;
System.Diagnostics.Debug.WriteLine("Output series");
Print(Series);
// Return forecasting series
Return BpfRes.NonCyclicalSeries;
End Function;
// Procedure of series values displaying in the console window
Public Shared Sub Print(Series: ITimeSeries);
Var
CultureInfo: CultureInfoClassClass = New CultureInfoClassClass();
i: Integer;
d: DateTime;
Begin
System.Diagnostics.Debug.Indent();
For i := Series.StartIndex To Series.EndIndex Do
d := Series.IndexToDate(i);
System.Diagnostics.Debug.WriteLine(CultureInfo.Current.FormatShortDate(d) + ": " + Series.Item[i]);
End For;
System.Diagnostics.Debug.Unindent();
System.Diagnostics.Debug.WriteLine("");
End Sub Print;
See also: