ConfidenceLevel: Double;
The ConfidenceLevel property determines the confidence limits relevance. The property is set to 0.95 by default.
Executing the example requires that the repository contains a modeling container with the KONT_MODEL identifier. The container contains the Var_1 variable, further used as an output one.
Sub Main;
Var
MB: IMetabase;
CrInf: IMetabaseObjectCreateInfo;
MObj: IMetabaseObject;
Model: IMsModel;
Trans: IMsFormulaTransform;
Varr: IMsVariableStub;
VarTrans: IMsFormulaTransformVariable;
Tree: IMsFormulaTransformSlicesTree;
Slice: IMsFormulaTransformSlice;
Selector: IMsFormulaTransformSelector;
Formula: IMsFormula;
CurveEst: IMsCurveEstimationTransform;
Begin
MB := MetabaseClass.Active;
CrInf := Mb.CreateCreateInfo;
CrInf.ClassId := MetabaseObjectClass.KE_CLASS_MSMODEL;
CrInf.Id := "New_CurvEstModel";
CrInf.Name := "New_CurvEstModel";
CrInf.Parent := Mb.ItemById("KONT_MODEL");
CrInf.Permanent := False;
MObj := Mb.CreateObject(CrInf).Edit;
Model := MObj As IMsModel;
Trans := Model.Transform;
Varr := MB.ItemByIdNamespace("Var_1", MB.ItemById("KONT_MODEL").Key).Bind As IMsVariableStub;
Trans.Outputs.Add(Varr);
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.CurveEstimation;
CurveEst := Formula.Method As IMsCurveEstimationTransform;
CurveEst.ConfidenceLevel := 0.99;
CurveEst.Criterion := DependenceCriterion.RSS;
CurveEst.DependenceFormIncluded(DependenceType.Compound) := True;
CurveEst.DependenceFormIncluded(DependenceType.Logarithmic) := True;
CurveEst.DependenceFormIncluded(DependenceType.Hyperbolic) := True;
MObj.Save;
End Sub Main;
After executing the example a model is created in the modeling container. The universal trend method is used for model calculation. As a result of method execution the composite, logarithmic and hyperbolic dependencies are calculated. The output model is selected by the least value of sum of squared residuals. The value 0.99 is set for confidence limits significance.
See also: