IMsECMEquation.AutoRegressionOrder

Syntax

AutoRegressionOrder: Array;

Description

The AutoRegressionOrder property determines whether autoregression coefficients are used in equation.

Comments

Autoregression coefficients are set as an array of integers. The number of array elements is determined by the order, and element values determine the lag for autoregression coefficients. To cancel the use of autoregression, set this property to Null.

Example

Executing the example requires that the repository contains a modeling container with the MS identifier containing vector error correction model with the MODEL_ECM identifier.

Add links to the Metabase and Ms system assemblies.

Sub UserProc;
Var
    MB: IMetabase;
    MObj: IMetabaseObjectDescriptor;
    Model: IMsModel;
    ModelTrans: IMsFormulaTransform;
    Formula: IMsFormula;
    Eqution: IMsECMEquation;
    Ar: Array[0..2Of Integer;
    Calc: IMsModelCalculation;
    Arr: Array Of Double;
    i: Integer;
Begin
    // Get current repository
    MB := MetabaseClass.Active;
    // Get modeling container
    MObj := MB.ItemById("MS");
    // Get vector model of error correction
    Model := MB.ItemByIdNamespace("MODEL_ECM", MObj.Key).Edit As IMsModel;
    ModelTrans := Model.Transform;
    Formula := ModelTrans.FormulaItem(0);
    // Get model calculation parameters
    Eqution := Formula.Method As IMsECMEquation;
    // Determine autoregression order
    Ar := New Integer[3];
    Ar[0] := 1;
    Ar[1] := 2;
    Ar[2] := 3;
    Eqution.AutoRegressionOrder := Ar;
    // Determine settings to calculate a model
    Calc := Model.CreateCalculation;
    Calc.Period.IdentificationStartDate := DateTime.ComposeDay(19900101);
    Calc.Period.IdentificationEndDate := DateTime.ComposeDay(20161231);
    Calc.Period.ForecastStartDate := DateTime.ComposeDay(20170101);
    Calc.Period.ForecastEndDate := DateTime.ComposeDay(20251231);
    // Get output variable data and display it in the console window
    Arr := Eqution.Result.Serie(Calc As IMsMethodCalculation);
    For i := 0 To Arr.Length - 1 Do
    Debug.WriteLine(Arr[i]);
    End For;
    // Save the model
    (Model As IMetabaseObject).Save;
End Sub UserProc;

After executing the example the autoregression order is changed for the first equation, the console window displays output variable data.

See also:

IMsECMEquation