IMsBpfResult.CycleSeries

Fore Syntax

CycleSeries: ITimeSeries;

Fore.NET Syntax

CycleSeries: Prognoz.Platform.Interop.Ms.ITimeSeries;

Description

The CycleSeries property returns cyclic component of the source series.

Comments

Using this interface, it is also possible to get:

Fore Example

Custom method of calculation which returns forecast values for any forecast 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 to the console window
    Series := BpfRes.Fitted;
    Debug.WriteLine("Modeling series");
    Print(Series);
    // Get residuals series and display it to the console window
    Series := BpfRes.Residuals;
    Debug.WriteLine("Residuals series");
    Print(Series);
    // Get modeled series and display it to the console window
    Series := BpfRes.TimeSeries;
    Debug.WriteLine("Modeled series");
    Print(Series);
    // Return forecast series
    Return BpfRes.NonCyclicalSeries;
End Function BpfResult;

After executing the example the console window displays calculation results of 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:

Fore.NET Example

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 to the console window
    Series := BpfRes.Fitted;
    System.Diagnostics.Debug.WriteLine("Modeling series");
    Print(Series);
    // Get residuals series and display it to the console window
    Series := BpfRes.Residuals;
    System.Diagnostics.Debug.WriteLine("Residuals series");
    Print(Series);
    // Get modeled series and display it to the console window
    Series := BpfRes.TimeSeries;
    System.Diagnostics.Debug.WriteLine("Modeled series");
    Print(Series);
    // Return forecast 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:

IMsBpfResult