Explained: IMsFormulaTerm;
The Explained property returns an output series.
Executing the example requires that the repository contains a modeling container with the KONT_MODEL identifier. The model with the MODEL_1 identifier is created in the container. This model uses the Baxter-King filter for calculation.
Add links to the Metabase and Ms system assemblies.
Sub UserProc;
Var
MB: IMetabase;
MObj: IMetabaseObject;
Model: IMsModel;
Trans: IMsFormulaTransform;
TransVar: IMsFormulaTransformVariable;
Tree: IMsFormulaTransformSlicesTree;
Slice: IMsFormulaTransformSlice;
Selector: IMsFormulaTransformSelector;
Formula: IMsFormula;
Bandpass: IMsBandpassFilterTransform;
Calc: IMsModelCalculation;
Period, MPeriod: IMsModelPeriod;
a: Array Of Double;
i: Integer;
Begin
// Get the current repository
MB := MetabaseClass.Active;
// Get model
MObj := MB.ItemByIdNamespace("MODEL_1", MB.ItemById("KONT_MODEL").Key).Bind;
Model := MObj As IMsModel;
// Get model parameters
Trans := Model.Transform;
TransVar := Trans.Outputs.Item(0);
Tree := TransVar.SlicesTree(TransVar);
Slice := Tree.CreateSlice(1);
Selector := Trans.CreateSelector;
Selector.Slice := Slice;
// Set up calculation options
Formula := Trans.Transform(Selector);
Bandpass := Formula.Method As IMsBandpassFilterTransform;
Calc := Model.CreateCalculation;
MPeriod := Model.Transform.Period;
Period := Calc.Period;
Period.IdentificationStartDate := MPeriod.IdentificationStartDate;
Period.IdentificationEndDate := MPeriod.IdentificationEndDate;
Period.ForecastStartDate := MPeriod.ForecastStartDate;
Period.ForecastEndDate := MPeriod.ForecastEndDate;
a := Bandpass.Explained.Serie(Calc As IMsMethodCalculation);
For i := 0 To a.Length - 1 Do
Debug.WriteLine(a[i]);
End For;
After executing the example the development environment console displays the data of output series.
See also: