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 modeling container (CONT_MODEL) contains a model (BinReg) that uses binary regression method for calculation.
Sub Main;
Var
MB: IMetabase;
MObj: IMetabaseObject;
Model: IMsModel;
Trans: IMsFormulaTransform;
VarTrans: IMsFormulaTransformVariable;
Tree: IMsFormulaTransformSlicesTree;
Slice: IMsFormulaTransformSlice;
Selector: IMsFormulaTransformSelector;
Formula: IMsFormula;
Binary: IMsBinaryRegressionTransform;
Calc: IMsModelCalculation;
Coord: IMsFormulaTransformCoord;
Coef: IModelCoefficients;
Estim: Array Of Double;
i: Integer;
Begin
MB := MetabaseClass.Active;
MObj := MB.ItemByIdNamespace("BinReg", MB.ItemById("CONT_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);
Binary := Formula.Method As IMsBinaryRegressionTransform;
// Determine the value of confidence limits
Binary.ConfidenceLevel := 0.9;
// Determine the missing data treatment method
Binary.MissingData.Method := MissingDataMethod.SampleAverage;
Calc := Model.CreateCalculation;
Calc.Period.IdentificationStartDate := DateTime.ComposeDay(2000, 01, 01);
Calc.Period.IdentificationEndDate := DateTime.ComposeDay(2007, 12, 31);
Calc.Period.ForecastStartDate := DateTime.ComposeDay(2007, 01, 01);
Calc.Period.ForecastEndDate := DateTime.ComposeDay(2010, 12, 31);
Coord := Trans.CreateCoord(VarTrans);
// Identification of new equation
Binary.Identify(Calc As IMsMethodCalculation, Coord);
// Receive the values of statistic descriptions
Coef := Binary.StatCoefficients(Coord);
// Array of evaluated values of model coefficients
Estim := Coef.Coefficients.Estimate;
// Display the array to console
For i := 0 To Estim.Length - 1 Do
Debug.WriteLine(Estim[i]);
End For;
MObj.Save;
End Sub Main;
After executing the example the model confidence relevance is 0.9. After equation identification the array of estimated model coefficients is displayed in the console window.
See also: