ILanerResultsBoxResults.Correlation

Syntax

Correlation: ILanerResultsBoxCorrelation;

Description

The Coerrelation property returns parameters required to work with values of the Correlation tab.

Comments

Correlation values are computed only for the series calculated using the Linear Regression method.

Example

Executing the example requires a form, a button with the Button1 identifier on the form, the LanerBox component, the LanerResultsBox component named LanerResultsBox1 and the UiErAnalyzer component used as a data source for LanerBox and LanerResultsBox. A workbook of the time series database must be loaded to UiErAnalyzer1.

The example is executed on clicking the button.

    Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
    Var
        Results: ILanerResultsBoxResults;
        Correlation: ILanerResultsBoxCorrelation;
        i, j: Integer;
        s: string;
    Begin
        Results := LanerResultsBox1.Results;
        Correlation := Results.Correlation;
        s := "";
        For i := 0 To Correlation.TermCount - 1 Do
            s := s + "    " + Correlation.Comment(i);
        End For;
        Debug.WriteLine(s);
        s := "";
        For i := 0 To Correlation.TermCount - 1 Do
            s := s + "    " + Correlation.Name(i);
        End For;
        Debug.WriteLine(s);
        For i := 0 To Correlation.TermCount - 1 Do
            s := "";
            For j := 0 To Correlation.TermCount - 1 Do
            s := s + "    " + Correlation.Value(i, j).ToString;
            End For;
            Debug.WriteLine(s);
        End For;
    End Sub Button1OnClick;

After executing the example the console window shows a correlation table that contains name, value, and comment for the variables taking part in the calculations. For example:

Comments:
    New series 1    Nigeria|BCA|A[t]    Nigeria|BCI|A[t]
Correlation table:
    Y    X1    X2
    1    -0.68230830806241394    0.49928242789261545
    -0.68230830806241394    1    -0.1197660822009501
    0.49928242789261545    -0.1197660822009501    1

See also:

ILanerResultsBoxResults