StatCoefficients(Coord: IMsFormulaTransformCoord): IModelCoefficients;
Coord. Output variable slice, for which calculation is executed.
The property is read-only.
The StatCoefficients property returns values of summary statistics calculated for identified equation coefficients.
Executing the example requires that a modeling container with the CONT_MODEL identifier contains a model with the BinReg identifier using 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 some parameters of the model are changed. After equation identification the array of estimated model coefficients is displayed in the console window.
See also: