IMsCurveEstimationTransform.ResidualsSerie

Syntax

ResidualsSerie: IMsVariableStub;

Description

The ResidualsSerie property determines the variable, to which the residual series is unloaded on modeling problem calculation. To cancel data unloading, set the property to Null.

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: IMsVariableStub;

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

Problem := MObj As IMsProblem;

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

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

Model.Series.Add(Residuals_Var As IMsVariable);

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.ResidualsSerie := 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