IMsCompositeFormulaTerm.ChangeLag

Syntax

ChangeLag (Value: Integer);

Parameters

Value. Value to which the current lag value must be modified.

Description

The ChangeLag method changes the lag value to the value that is passed by the parameter Value.

Example

Executing the example requires a modeling container of model with the NEW_LINREG identifier. The linear regression method is used for model calculation.

Sub Main;

Var

MB: IMetabase;

MObj: IMetabaseObject;

Model: IMsModel;

Trans: IMsFormulaTransform;

VarTrans: IMsFormulaTransformVariable;

Tree: IMsFormulaTransformSlicesTree;

Slice: IMsFormulaTransformSlice;

Selector: IMsFormulaTransformSelector;

Formula: IMsFormula;

LinReg: IMsLinearRegressionTransform;

TransVar: IMsFormulaTransformVariable;

ComposForm: IMsCompositeFormulaTermList;

ComposTerm: IMsCompositeFormulaTerm;

Begin

MB := MetabaseClass.Active;

MObj := MB.ItemByIdNamespace("New_LinReg", MB.ItemById("KONT_MODEL").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);

Formula.Kind := MsFormulaKind.LinearRegression;

LinReg := Formula.Method As IMsLinearRegressionTransform;

TransVar := Model.Transform.Inputs.Item(0);

ComposForm := LinReg.Explanatories;

ComposTerm := ComposForm.Item(0);

ComposTerm.Inversion := MsInversion.Normalization;

ComposTerm.InversionLag := MsInversionLag.PrecidingValue;

ComposTerm.ChangeLag(-5);

MObj.Save;

End Sub Main;

After executing the example, lag and parameters of initial transformation are changed for the first compound term of the model. The lag value is increased for 5.

See also:

IMsCompositeFormulaTerm