IMsArimaTransform.AutoCorrelation

Syntax

AutoCorrelation(Calculation: IMsMethodCalculation;
                Coord: IMsFormulaTransformCoord;
                Var ACF: Array;
                Var PACF: Array;
                Var QStatistics: Array;
                Var Probability: Array);

Parameters

Calculation. Model calculation options.

Coord. Output variable slice, for which calculation is executed.

ACF. Real array with values of autocorrelation function.

PACF. Real array with values of partial autocorrelation function.

QStatistics. Real array with values of the Ljung-Box q-statistic.

Probability. Real array with probability values of the Ljung-Box q-statistic.

Description

The AutoCorrelation method executes autocorrelation analysis of a model.

Comments

After executing the method the analysis results contain the ACF, PACF, QStatistics and Probablity parameters.

Example

Executing the example requires that the repository contains a modeling container with the CONT_MODEL identifier. The container includes the ARIMA model with the MODEL identifier.

Add links to the Metabase, Ms system assemblies.

Sub UserProc;
Var
    MB: IMetabase;
    Model: IMsModel;
    Transform: IMsFormulaTransform;
    VarTrans: IMsFormulaTransformVariable;
    Tree: IMsFormulaTransformSlicesTree;
    Slice: IMsFormulaTransformSlice;
    Selector: IMsFormulaTransformSelector;
    Formula: IMsFormula;
    Arima: IMsArimaTransform;
    Coord: IMsFormulaTransformCoord;
    Calc: IMsModelCalculation;
    acf, pacf, qs, prob: Array Of Double;         
    Sub PrintArray(a: Array Of Double);
    Var
        i: Integer;
    Begin
        For i := 0 To a.Length - 1 Do
            Debug.WriteLine(a[i]);
        End For;
    End Sub PrintArray;
Begin
    MB := MetabaseClass.Active;
    Model := MB.ItemByIdNamespace("MODEL", MB.ItemById("CONT_MODEL").Key).Bind As IMsModel;
    Transform := Model.Transform;
    VarTrans := Transform.Outputs.Item(0);
    Tree := VarTrans.SlicesTree(VarTrans);
    Slice := Tree.CreateSlice(1);
    Selector := Transform.CreateSelector;
    Selector.Slice := Slice;
    Formula := Transform.Transform(Selector);
    Arima := Formula.Method As IMsArimaTransform;
    Coord := Transform.CreateCoord(VarTrans);
    Calc := Model.CreateCalculation;
    Calc.Period.IdentificationStartDate := DateTime.ComposeDay(20000101);
    Calc.Period.IdentificationEndDate := DateTime.ComposeDay(20051231);
    Calc.Period.ForecastStartDate := DateTime.ComposeDay(20060101);
    Calc.Period.ForecastEndDate := DateTime.ComposeDay(20101231);
    Arima.AutoCorrelation(Calc As IMsMethodCalculation, Coord, acf, pacf, qs, prob);
    Debug.WriteLine(---- Autocorrelation function ----);
    PrintArray(acf);
    Debug.WriteLine(---- Partial autocorrelation function ----);
    PrintArray(pacf);
    Debug.WriteLine(---- Ljung-Box q-statistic ----);
    PrintArray(qs);
    Debug.WriteLine(---- probability of q-statistic ----);
    PrintArray(prob);
End Sub UserProc;

After executing the example the results of autocorrelation analysis of the model are displayed in the console window.

See also:

IMsArimaTransform