IMsX11Result.B1

Syntax

B1: ITimeSeries;

Description

The B1 property returns a prior adjusted series or source series.

Comments

This interface also enables the user to get:

The X11 method is supported only in Windows.

Example

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 X11Result(Result: Variant): ITimeSeries;
Var
    X11Res: IMsX11Result;
    Series: ITimeSeries;
Begin
    X11Res := Result As IMsX11Result;
    // Display method name
    Debug.WriteLine("Method name: " + X11Res.BaseMethod.Name);
    Debug.WriteLine("");
    // Get series after prior adjustment or source series and display it in the console window
    Series := X11Res.B1;
    Debug.WriteLine("Series after a prior adjustment or source series");
    Print(Series);
    // Get seasonal component of the source series and display it in the console window
    Series := X11Res.D10;
    Debug.WriteLine("Seasonal component of the source series");
    Print(Series);
    // Get seasonal adjustment and display it in the console window
    Series := X11Res.D11;
    Debug.WriteLine("Seasonal adjustment");
    Print(Series);
    // Get trend-cycle component and display it in the console window
    Series := X11Res.D12;
    Debug.WriteLine("Trend-cycle component");
    Print(Series);
    // Get irregular component and display it in the console window
    Series := X11Res.D13;
    Debug.WriteLine("Irregular component");
    Print(Series);
    // Return forecast series
    Return X11Res.Fitted;
End Function X11Result;

// Procedure of series values displaying in the console window
Sub Print(Series: ITimeSeries);
Var
    i: Integer;
    d: DateTime;
Begin
    Debug.Indent;
    For i := Series.StartIndex To Series.EndIndex Do
        d := Series.IndexToDate(i);
        Debug.WriteLine(CultureInfo.Current.FormatShortDate(d) + ": " + Series.Item(i));
    End For;
    Debug.Unindent;
    Debug.WriteLine("");
End Sub Print;

After executing the example the console window displays results of the X11 method calculation.

This custom method can be used in determinate equation, in calculator nbsp; in time series analysis and in expression editor. For example, the use of custom method in determinate equation:

IMSX11RESULT_B1.X11Result(x11(X1, Null, MsOutputSeriesType.B1, SeasonalityType.Multiplicative))

Where:

See also:

IMsX11Result