Explained: IMsFormulaTerm;
The Explained property returns output series.
Executing the example requires that the repository contains a modeling container with the MODEL_SPACE identifier. A model with the New_2SLS identifier created in this container uses the method of linear regression for calculation (instrumental variables estimation).
It is also necessary to add links to the Metabase, Ms system assemblies.
Sub UserProc;
Var
MB: IMetabase;
MObj: IMetabaseObject;
Model: IMsModel;
Trans: IMsFormulaTransform;
VarTrans: IMsFormulaTransformVariable;
Tree: IMsFormulaTransformSlicesTree;
Slice: IMsFormulaTransformSlice;
Selector: IMsFormulaTransformSelector;
Formula: IMsFormula;
SLS: IMs2SLSTransform;
Calc: IMsModelCalculation;
Exp: Array Of Double;
i: Integer;
Begin
MB := MetabaseClass.Active;
MObj := MB.ItemByIdNamespace("New_2SLS", MB.ItemById("MODEL_SPACE").Key).Edit;
Model := MObj As IMsModel;
Trans := Model.Transform;
VarTrans := Trans.Outputs.Item(0);
Tree := VarTrans.SlicesTree(VarTrans);
Slice := Tree.CreateSlice(1);
Selector := Model.Transform.CreateSelector;
Selector.Slice := Slice;
Formula := Model.Transform.Transform(Selector);
SLS := Formula.Method As IMs2SLSTransform;
Calc := Model.CreateCalculation;
Calc.Period.IdentificationStartDate := DateTime.ComposeDay(1990, 01, 01);
Calc.Period.IdentificationEndDate := DateTime.ComposeDay(2000, 12, 31);
Calc.Period.ForecastStartDate := DateTime.ComposeDay(2001, 01, 01);
Calc.Period.ForecastEndDate := DateTime.ComposeDay(2010, 01, 01);
Exp := SLS.Explained.Serie(Calc As IMsMethodCalculation);
For i := 0 To Exp.Length - 1 Do
Debug.WriteLine(Exp[i]);
End For;
End Sub UserProc;
After executing the example, an output series of a model is obtained. The output series values are displayed in the development environment console.
See also: