IMsBinaryRegressionTransform.ForecastTermSet

Syntax

ForecastTermSet: IMsFormulaTermSet;

Description

The ForecastTermSet property returns a set of series, to which forecast data is loaded when calculating modeling problem.

NOTE. The dimension of the ForecastTermSet set must be equal to the dimension of the explanatory variable set (IMsBinaryRegressionTransform.Explained).

Example

To execute the example, the modeling container (CONT_MODEL) must contain a model (BinReg), that uses the binary regression method for calculation. The set dimension of model explanatory variable is equal to one. Also, in this container the FORECAST variable must be present.

Sub Main;

Var

MB: IMetabase;

SpaceDescr: IMetabaseObjectDescriptor;

MObj: IMetabaseObject;

Model: IMsModel;

Trans: IMsFormulaTransform;

VarTrans: IMsFormulaTransformVariable;

Tree: IMsFormulaTransformSlicesTree;

Slice: IMsFormulaTransformSlice;

Selector: IMsFormulaTransformSelector;

Formula: IMsFormula;

Binary: IMsBinaryRegressionTransform;

Var_out: IMsVariable;

pF_out: IMsFormulaTransformVariable;

Begin

MB := MetabaseClass.Active;

SpaceDescr := mb.ItemById("CONT_MODEL");

MObj := MB.ItemByIdNamespace("BinReg", SpaceDescr.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);

Binary := Formula.Method As IMsBinaryRegressionTransform;

// Determination of variable for forecast data loading

Var_out := mb.ItemByIdNamespace("FORECAST", SpaceDescr.Key).Bind As IMsVariable;

pF_out := Trans.Outputs.Add(Var_out As IVariableStub);

Binary.ForecastTermSet.Clear;

Binary.ForecastTermSet.Add(pF_out.Slices.Add(Null));

MObj.Save;

End Sub Main;

Example execution result: at problem calculation the forecast data is loaded to the FORECAST variable.

See also:

IMsBinaryRegressionTransform