IMsCurveEstimationTransform.Residuals

Syntax

Residuals: IVariableStub;

Description

The Residuals property determines the variable, to which residual series is unloaded on modeling problem calculation.

Comments

The property is outdated, use IMsMethodSeries.Residuals.

Example

Executing the example requires a modeling problem in the container. The first model included into the problem uses the universal trend method for calculation.

Sub Main;

Var

MB: IMetabase;

KontKey: Integer;

MObj: IMetabaseObject;

Problem: IMsProblem;

CalcSett: IMsProblemCalculationSettings;

Calculation: IMsProblemCalculation;

Model: IMsModel;

Trans: IMsFormulaTransform;

VarTrans: IMsFormulaTransformVariable;

Tree: IMsFormulaTransformSlicesTree;

Slice: IMsFormulaTransformSlice;

Selector: IMsFormulaTransformSelector;

Formula: IMsFormula;

CurveEst: IMsCurveEstimationTransform;

Residuals_Var: IVariableStub;

Begin

MB := MetabaseClass.Active;

KontKey := MB.ItemById("KONT_MODEL").Key;

MObj := MB.ItemByIdNamespace("PROBLEM_1", KontKey).Edit;

//variables to which the data are loaded

Residuals_Var := MB.ItemByIdNamespace("Residuals_Var", KontKey).Edit As IVariableStub;

Problem := MObj As IMsProblem;

Model := (Problem.MetaModel.CalculationChain.Item(0) As IMsCalculationChainModel).Model;

Model := (Model As IMetabaseObject).Edit As IMsModel;

Model.Transform.Series.Add(Residuals_Var);

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);

CurveEst := Formula.Method As IMsCurveEstimationTransform;

//residual series

CurveEst.Residuals := Residuals_Var;

CalcSett := Problem.CreateCalculationSettings;

Calculation := Problem.Calculate(CalcSett);

Calculation.Run;

(Model As IMetabaseObject).Save;

MObj.Save;

End Sub Main;

After executing the example the variable with the Residuals_Var identifier is added to the list of output variables of the model. After calculating the problem the residual series is unloaded to it.

See also:

IMsCurveEstimationTransform