AddFactor: IMsFormulaTermInfo;
AddFactor: Prognoz.Platform.Interop.Ms.IMsFormulaTermInfo;
The AddFactor property determines the added factor.
The added factor is used for forecast adjustment. It is not included to the generated model name.
By default the added factor is absent.
AddFactor may be used in the following models:
Linear regression (estimation by instrumental variables method).
Linear regression (OLS estimation method).
Error correction model. Added factor is set for each equation in the model, but not for all model in the whole.
Executing the example requires that the repository contains a modeling container with the CONT_MODEL identifier, that contains a model (determinate equation) with the MODEL identifier. The container must also include a variable with the VAR_ADD identifier.
Add links to the Metabase, Ms, Cubes system assemblies.
Sub UserProc;
Var
mb: IMetabase;
ContModelKey: Integer;
Model: IMsModel;
Variable: IVariableStub;
Transform: IMsFormulaTransform;
Formula: IMsFormula;
Method: IMsDeterministicTransform;
Series: IMsMethodSeries;
TransVar: IMsFormulaTransformVariable;
Term: IMsFormulaTermInfo;
Slice: IMsFormulaTransformSlice;
Begin
mb := MetabaseClass.Active;
ContModelKey := mb.ItemById("CONT_MODEL").Key;
Model := mb.ItemByIdNamespace("MODEL", ContModelKey).Edit As IMsModel;
Variable := MB.ItemByIdNamespace("VAR_ADD", ContModelKey).Bind As IVariableStub;
Transform := Model.Transform;
Formula := Transform.FormulaItem(0);
Method := Formula.Method As IMsDeterministicTransform;
Series := Method.Series;
TransVar := Transform.Inputs.Add(Variable);
Term := Transform.CreateTermInfo;
Slice := TransVar.Slices.Add(Null);
Term.Slice := Slice;
Series.AddFactor := Term;
(Model As IMetabaseObject).Save;
End Sub UserProc;
After executing the example, the VAR_ADD added factor is used to adjust forecast in the model of determinate equation.
See also: