DiagnosticTests([Calculation: IMsMethodCalculation = Null;]
[Coord: IMsFormulaTransformCoord = Null]): IMsDiagnosticTestList;
Calculation. Settings that are necessary for calculation.
Coord. The slice, by which calculation is executed.
The DiagnosticTests property returns a set of diagnostic tests of the model.
The test set cannot be changed, that is, it is not possible to remove the existing one or add a new custom test.
Executing the example requires that the repository contains a modeling container with the MS identifier containing an ARIMA model with the MODEL identifier.
Add links to the Metabase, Ms, Stat system assemblies.
Sub UserProc;
Var
mb: IMetabase;
MsKey: Integer;
Model: IMsModel;
Transform: IMsFormulaTransform;
Formula: IMsFormula;
Arima: IMsArimaTransform;
TestList: IMsDiagnosticTestList;
Test: IMsDiagnosticTest;
DSettings: IMsRamseyRessetTestSettings;
VarTrans: IMsFormulaTransformVariable;
Coord: IMsFormulaTransformCoord;
Calc: IMsMethodCalculation;
DResults: IMsDiagnosticTestResults;
Stat: ISpecificationTestStatistic;
Begin
MB := MetabaseClass.Active;
// Get modelling container key
MsKey := MB.GetObjectKeyById("MS");
// Get model
Model := MB.ItemByIdNamespace("MODEL", MsKey).Bind As IMsModel;
// Get model calculation parameters
Transform := Model.Transform;
Formula := Transform.FormulaItem(0);
Arima := Formula.Method As IMsArimaTransform;
// Get set of model diagnostic tests
TestList := Arima.DiagnosticTests;
// Find the Functional Form Criterion test
Test := TestList.FindByType(MsDiagnosticTestType.RamseyResset);
// Get test parameters
DSettings := Test.Settings As IMsRamseyRessetTestSettings;
// Set the number of additional regressors included into test regression.
DSettings.Power := 3;
// Set testing periods
VarTrans := Transform.Outputs.Item(0);
Coord := Transform.CreateCoord(VarTrans);
Calc := Model.CreateCalculation As IMsMethodCalculation;
Calc.Period.IdentificationStartDate := DateTime.ComposeDay(1990, 01, 01);
Calc.Period.IdentificationEndDate := DateTime.ComposeDay(2007, 12, 31);
Calc.Period.ForecastStartDate := DateTime.ComposeDay(2008, 01, 01);
Calc.Period.ForecastEndDate := DateTime.ComposeDay(2010, 12, 31);
// Execute testing
DResults := Test.Execute(Calc As IMsMethodCalculation, Coord);
// Output test results
Stat := DResults.ChiTest;
Debug.WriteLine("-- Chi-square statistic --");
Debug.Write(" Value: ");
Debug.WriteLine(Stat.Statistic);
Debug.Write(" Probability: ");
Debug.WriteLine(Stat.Probability);
Stat := DResults.FTest;
Debug.WriteLine("-- Fisher statistic --");
Debug.Write(" Value: ");
Debug.WriteLine(Stat.Statistic);
Debug.Write(" Probability: ");
Debug.WriteLine(Stat.Probability);
End Sub UserProc;
After executing the example the Functional Form Criterion diagnostic test is executed for the MODEL model, testing results are displayed in the console window.
See also: